Add column status_tree based on the status of all stems of each tree.

add_status_tree(data, status_a = "A", status_d = "D")

Arguments

data

A ForestGEO-like dataframe: A ViewFullTable, tree or stem table.

status_a, status_d

Sting to match alive and dead stems; it corresponds to the values of the variable status (in census tables) or Status (with capital "S" in ViewFull tables).

Value

The input data set with the additional variable status_tree.

See also

Other functions to add columns to dataframes: add_subquad(), add_var()

Other functions for ForestGEO data: add_subquad(), add_var()

Other functions for fgeo census: add_var(), guess_plotdim(), pick_drop

Other functions for fgeo vft: add_subquad(), add_var(), guess_plotdim(), pick_drop

Examples

# styler: off
stem <- tribble(
  ~CensusID, ~treeID, ~stemID, ~status,
          1,       1,       1,     "A",
          1,       1,       2,     "D",

          1,       2,       3,     "D",
          1,       2,       4,     "D",



          2,       1,       1,     "A",
          2,       1,       2,     "G",

          2,       2,       3,     "D",
          2,       2,       4,     "G"
)
# styler: on

add_status_tree(stem)
#> # A tibble: 8 × 5
#>   CensusID treeID stemID status status_tree
#>      <dbl>  <dbl>  <dbl> <chr>  <chr>      
#> 1        1      1      1 A      A          
#> 2        1      1      2 D      A          
#> 3        1      2      3 D      D          
#> 4        1      2      4 D      D          
#> 5        2      1      1 A      A          
#> 6        2      1      2 G      A          
#> 7        2      2      3 D      A          
#> 8        2      2      4 G      A