forestgeo / fgeo.biomass

Calculate biomass with allometric equations from the allodb package and ForestGEO data
https://forestgeo.github.io/fgeo.biomass
GNU General Public License v3.0
8 stars 4 forks source link

Warn (once) if dead trees are detected in the census data #21

Open maurolepore opened 5 years ago

maurolepore commented 5 years ago

@gonzalezeb and @teixeirak,

Some dead trees in SCBI have non-missing dbh values. Am I right in thinking that some other ForestGEO plots do not record dbh of dead trees?

library(tidyverse)

fgeo.biomass::scbi_tree1 %>% 
  filter(status != "A") %>%
  select(matches("status"), dbh) %>% 
  as_tibble()
#> # A tibble: 10,228 x 3
#>    DFstatus status   dbh
#>    <chr>    <chr>  <dbl>
#>  1 dead     D       42.6
#>  2 dead     D       37  
#>  3 dead     D      318  
#>  4 dead     D      179. 
#>  5 dead     D      203. 
#>  6 dead     D      137. 
#>  7 dead     D       55  
#>  8 dead     D      164. 
#>  9 dead     D      242. 
#> 10 dead     D      238. 
#> # ... with 10,218 more rows

fgeo.biomass::scbi_tree1 %>% 
  mutate(missing_dbh = if_else(is.na(dbh), TRUE, FALSE)) %>% 
  select(matches("status"), missing_dbh) %>%
  arrange(status, DFstatus) %>% 
  unique()
#> # A tibble: 7 x 3
#>   DFstatus  status missing_dbh
#>   <chr>     <chr>  <lgl>      
#> 1 alive     A      FALSE      
#> 2 alive     A      TRUE       
#> 3 lost_stem A      FALSE      
#> 4 dead      D      FALSE      
#> 5 dead      D      TRUE       
#> 6 missing   M      TRUE       
#> 7 prior     P      TRUE

Created on 2019-03-14 by the reprex package (v0.2.1)

teixeirak commented 5 years ago

Let's display a warning (for the entire run, not per tree!): "Live tree allometries applied to calculate biomass on dead trees."

Really, I don't think we should need to warn about dead trees at the step of calculating biomass, but it may be good to give this reminder, and also to highlight that biomass will be overestimated on trees that have undergone a fair amount of decomposition.

We'll mainly care about live/dead later--- for example, a function that sums individual biomass values to get whole-ecosystem biomass will definitely need to have users specify whether dead trees should be included.