Git Product home page Git Product logo

Comments (6)

maurolepore avatar maurolepore commented on June 25, 2024 1

You can replace all of them if you want, but will the csv file also be updated? Otherwise I will do it.

No, the kind of fix I would do in code is downstream from the .csv files. In my opinion, the more you can do directly the better. Every new code statement increases the chance of bugs.

from fgeo.biomass.

maurolepore avatar maurolepore commented on June 25, 2024 1

(Now following up at ropensci/allodb#83.)

@teixeirak

I'm assuming that the limits imposed by dbh_min/max are inclusive (see example below). Is my assumption correct?

# Inclusive limits
fgeo.biomass:::is_in_range(1, 1, 10)
#> [1] TRUE
fgeo.biomass:::is_in_range(10, 1, 10)
#> [1] TRUE

# Out of bounds
fgeo.biomass:::is_in_range(11, 1, 10)
#> [1] FALSE
fgeo.biomass:::is_in_range(0, 1, 10)
#> [1] FALSE

# Well within the limit
fgeo.biomass:::is_in_range(5, 1, 10)
#> [1] TRUE

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

from fgeo.biomass.

gonzalezeb avatar gonzalezeb commented on June 25, 2024

there are 23 equations in equation table with some type of missing dbh range value (NRA, NI, NA)..

You can replace all of them if you want, but will the csv file also be updated? Otherwise I will do it.

I will make sure to mention that not just in the code but in our methods.

from fgeo.biomass.

maurolepore avatar maurolepore commented on June 25, 2024

(Now following up at ropensci/allodb#84.)

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.

@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"?

  • Example: Notice that rowid 1and 2 have a different range dbh range. Of course, the actual dbh value (i.e. 194) falls within the range, but maybe other equations were dropped because they represented a range that doesn't include dbh = 194.
#>    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  

...

from fgeo.biomass.

maurolepore avatar maurolepore commented on June 25, 2024

This can be disregarded. I had suspected that some rowids might have more than one equation that covered the entire tree-body. This came from observing something like the following:

#>    rowid anatomic_relevance          dbh dbh_min_mm dbh_max_mm
#>  8   266 total aboveground biomass  37.6       30        640  
#>  9   266 total aboveground biomass  37.6        3.7       68.3

But I confirm that this is NOT the case, when expert/generic and dbh ranges are considered.

image

Reprex:

library(tidyverse)
library(allodb)

master_tidy() %>% 
  select(
    site, 
    equation_group, 
    species, 
    equation_id, 
    dependent_variable_biomass_component,
    matches("dbh")
  ) %>% 
  filter(site == "scbi") %>% 
  filter(str_detect(dependent_variable_biomass_component, "Total|Whole")) %>% 
  unique() %>% 
  arrange(species, dbh_min_cm) %>% 
  group_by(equation_group) %>% 
  filter(
    str_detect(
      "^Expert$", paste0(sort(unique(equation_group)), collapse = ", ")
    )
  ) %>% 
  add_count(species) %>%
  filter(n > 1) %>%
  select(-n)

from fgeo.biomass.

maurolepore avatar maurolepore commented on June 25, 2024

I'm closing this now. Althought some issues remain, they have been extracted as independent issues of their own.

from fgeo.biomass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.