Closed teixeirak closed 3 years ago
RE your item 3 above:
I think your idea is a good one. Your database can have a column with an optional message
for each row (equation), and a column with the condition
that throws the error, e.g.
any( DBH < min_DBH, DBH > max_DBH )
The contents of the column condition
should be valid R code; if it evaluetes to TRUE
, then the message is produced. If the issues may vary in severity, we may need an additional column giving the condition_type
such as inform
, warn
, or abort
-- that is, an instruction to tell R what to do appart from producing a message.
Conclusion regarding statement above based on discussion: As we're controlling the package, there shouldn't be any instances that would warrant "abort". All messages entered in @gonzalezeb's tables should be interpreted as warnings. @maurolepore's code will throw some general warnings.
Regarding [2] in the top comment, this sort of error will not be possible within the master version. However, users could edit the tables offline and run the code. For this reason, it may make sense for the code to include an abort function to deal with unacceptable practices (e.g., if user attempts to apply an allometry way outside its range).
@cpiponiot Let's try to discuss some aspects of this issue today 5/12.
Jim Lutz recommends that the R code should generate warning messages when unreliable allometries are applied.
There are several issues that need to be decided:
What are the criteria that should generate a warning / error message? Here's the start of a list:
Should the code allow bad allometries to be applied? A couple examples:
How is this implemented in the database and code?