fgeo icon indicating copy to clipboard operation
fgeo copied to clipboard

Correct handling of status in add_status_tree()

Open LisaHuelsmann opened this issue 5 years ago • 0 comments

It seems the function add_status_tree() is not properly handling status codes other than A or D. More specifically, all stems (and thus also the corresponding trees) with a status of either G = gone, M = missing or P = prior are considered as alive. I was not able to control for this with the arguments status_a and status_d.

# modified code from the example

stem <- tribble(
  ~CensusID, ~treeID, ~stemID, ~status,
  1,       1,       1,     "P",
  1,       1,       2,     "P",
  
  1,       2,       3,     "A",
  1,       2,       4,     "D",
  
  1,       3,       5,     "D",
  1,       3,       6,     "D",
  
  
  2,       1,       1,     "A",
  2,       1,       2,     "G",
  
  2,       2,       3,     "D",
  2,       2,       4,     "G",
  
  2,       3,       5,     "M",
  2,       3,       6,     "M"
)

add_status_tree(stem)

LisaHuelsmann avatar Jun 19 '19 14:06 LisaHuelsmann