drop_twice_dead: Remove trees found dead in both the last and previous last...

Description Usage Arguments Value See Also Examples

Description

Removes trees that were found dead both in the last and previous last censuses. Thus the resulting data set contains trees that in the last census were found either alive or dead for the first time.

Usage

1

Arguments

vft

A dataframe – specifically a ForestGEO ViewFullTable with variables status_tree (see fgeo.tool::add_status_tree()).

Value

A modified version of the input data set: * With the rows removed of all censuses except the last two. * With the rows removed of trees found dead on both the last and previous last censuses.

See Also

Other functions to pick or drop rows of a ForestGEO dataframe: pick_plotname

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
vft <- tibble::tribble(
  ~CensusID, ~Treeid,   ~Status,
  1,    1,   "alive",  # Irrelevant: not one of the last two censuses
  1,    1,    "dead",  # 
  
  1,    2,   "alive",  # Irrelevant: not one of the last two censuses
  1,    2,   "alive",  # 
  
  2,    1,   "alive",  # Tree is alive: at lease one stem is alive
  2,    1,    "dead",  # 
  
  2,    2,    "dead",  # Tree is dead: all stems are dead. Notice that
  2,    2,    "dead",  # this tree is also dead in census 3.
  
  3,    1,   "alive",  # Tree is alive: at lease one stem is alive
  3,    1,    "dead",  # 
  
  3,    2,    "dead",  # Tree is dead: all stems are dead. Notice that
  3,    2,    "dead"   # this tree is also dead in census 2.
)

# `Status` refers to stems while `status_tree` refers to trees.
vft <- fgeo.tool::add_status_tree(vft, status_a = "alive", status_d = "dead")

# * Remove all censuses except the last two.
# * Remove trees found dead on both the last and previous last censuses.
drop_twice_dead(vft)

forestgeo/fgeo.misc documentation built on June 23, 2019, 6:26 p.m.