Closed maurolepore closed 3 years ago
@gonzalezeb, here I point to some equations that currently contain invalid code and I suggest the solutions. Let me know if you have questions or need help.
This is great Mauro. Two fixes can be applied now and I will work on the other two:
fix_problem("attempt", "([0-9])(\(log10)", "\1 * \2")
fix_problem("unexpected ')'", "\)$", "")
A questions for you: I would like the changes to be applied to our master table (data-raw/allodb-master) but as the code is written now changes would be applied to data/equations. How do I work around it?
You are right, the equations come from the equation table, and the changes are not applied back to any table.
eqn <- equations$equation_allometry`.
You could do something like this:
# Inputs a vector and outputs a dataframe
fixed_dataframe <- fix_problem(master$equations, ...)
master$equations <- fixed_dataframe$equations
This kind of "find and replace" you could also do in excel. But go for it if you want to do it in R. I think it's the best way to learn.
I reviewed and fixed the equations (the easiest way!). thanks Mauro. For dba or what I call, the srub problem please see issue #41
(Details.)
Great work @gonzalezeb; thanks!
Now all except one error relates to 'dba', which I'll follow up in #41. The exception relates to 'BA'. I had missed this error before. What should we do about it?
Relates to #54 .
I plan to write a test to automatically check that each equation can be evaluated -- i.e. that it contains valid R code. Once that is done, we'll be able to press
Control + Shift + T
to run this (and all other) test, and we'll get an informative error message if some equation isn't valid R code.