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.
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..
Follow up https://github.com/forestgeo/allodb/pull/158
This PR adds the new internal function
validate_equations()
and tests that all equations inequations$equation_allometry
are a valid R expression of thedbh
orh
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.