ropensci / allodb

An R package for biomass estimation at extratropical forest plots.
https://docs.ropensci.org/allodb/
GNU General Public License v3.0
36 stars 11 forks source link

Should we record the total number of components making up the whole-tree biomass? #84

Closed maurolepore closed 5 years ago

maurolepore commented 5 years ago

(Moving here from https://github.com/forestgeo/fgeo.biomass/issues/27#issuecomment-475041500 to ensure I don't forget to address this issue.)

@teixeirak,

Maybe a new column should record parts of a whole? E.g. a set of equations with 3 parts should be labelled like "1/3", "2/3", and "3/3"?

The dbh ranges are different for different parts of a tree (e.g. dbh_min_mm is 142 and 25 for rowid 6 and 7). If a row is within the range some but not all the equations that make up the entire body of a tree, then the biomass will be sum for only the body parts in the adequate range. In other words, some partes of a tree will not be represented at all and this could result in underestimating biomass. There is currently no way for the code to know if a crucial equaiton has been lost.

#>    rowid anatomic_relevance          dbh dbh_min_mm dbh_max_mm
#>  6   228 stem (wood and bark)      194.       142.       267. 
#>  7   228 foliage total             194.        25        400  

Full reprex

library(tidyverse)
#> Warning: package 'purrr' was built under R version 3.5.3
library(fgeo.biomass)
set.seed(1)

data <- fgeo.biomass::scbi_tree1 %>%
  dplyr::sample_n(1000) %>%
  filter(!is.na(dbh)) %>%
  add_species(fgeo.biomass::scbi_species, "scbi")
#> Adding `site`.
#> Overwriting `sp`; it now stores Latin species names.
#> Adding `rowid`.

allo_find(data) %>% 
  add_count(rowid) %>% 
  filter(n > 1) %>% 
  select(rowid, anatomic_relevance, dbh, dbh_min_mm, dbh_max_mm)
#> Assuming `dbh` in [mm] (required to find dbh-specific equations).
#> * Searching equations according to site and species.
#> Warning: Can't find equations matching these species:
#> carya sp, quercus prinus, ulmus sp, unidentified unk
#> * Refining equations according to dbh.
#> Warning: Can't find equations for 440 rows (inserting `NA`).
#> # A tibble: 15 x 5
#>    rowid anatomic_relevance          dbh dbh_min_mm dbh_max_mm
#>    <int> <chr>                     <dbl>      <dbl>      <dbl>
#>  1   182 stem biomass (with bark)  212.        89.       254  
#>  2   182 branches (live, dead)     212.        50        450  
#>  3   182 foliage total             212.        50        450  
#>  4   185 total aboveground biomass 143.        40        420  
#>  5   185 stem (wood and bark)      143.       142.       259. 
#>  6   228 stem (wood and bark)      194.       142.       267. 
#>  7   228 foliage total             194.        25        400  
#>  8   266 total aboveground biomass  37.6       30        640  
#>  9   266 total aboveground biomass  37.6        3.7       68.3
#> 10   289 branches (live, dead)      58         50        450  
#> 11   289 foliage total              58         50        450  
#> 12   630 total aboveground biomass  37.3       30        640  
#> 13   630 whole tree (above stump)   37.3        4         84.9
#> 14   654 branches (live, dead)      87.5       50        450  
#> 15   654 foliage total              87.5       50        450

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

teixeirak commented 5 years ago

This relates to issue #82. I don't think that numbering them would be the best option. For now it would suffice, but in the future we'll probably want more flexibility as to how we sum different components (e.g, just aboveground vs roots included). I will address this in issue #82.

maurolepore commented 5 years ago

I will address this in issue #82.