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

New `validate_equations()` #159

Closed maurolepore closed 3 years ago

maurolepore commented 3 years ago

Follow up https://github.com/forestgeo/allodb/pull/158

This PR adds the new internal function validate_equations() and tests that all equations in equations$equation_allometry are a valid R expression of the dbh or h variables.

This function can be called from inside any function allodb that allows users to pass a character vector of equations.

Note this function does not check that the equations make sense from a conceptual point of view but only that the text of the equation can be parsed as a valid R expression.

gonzalezeb commented 3 years ago

Yes, validate_equations() test that the allometries in the equation table are a valid R expression. Early on, we had tested that all equations make sense, conceptually..