Closed droglenc closed 1 year ago
In v0.9.4 of FSA
, the error described above will look like this ...
wsVal("Bighead Carp")
species units type ref measure method min.len max.len int
7 Bighead Carp metric linear 50 TL RLP 160 NA -4.65006
slope quad source comment
7 2.88934 NA Lamer et al. (2019) none
Error: There is no Ws equation with ref of 75 for Bighead Carp.
Please see relevant portion of `WSlit` above.
In addition, this is what a bet units=
error will look like ...
wsVal("Ruffe",units="English")
species units type ref measure method min.len max.len int
141 Ruffe metric quadratic 50 TL EmP 55 205 -3.3524
142 Ruffe metric quadratic 75 TL EmP 55 205 -2.5800
slope quad source comment
141 1.3969 0.4054 Ogle and Winfield (2009) none
142 0.6210 0.6073 Ogle and Winfield (2009) none
Error: There is no Ws equation in English units for Ruffe.
Please see relevant portion of `WSlit` above.
And, a bad species=
error ...
wsVal("Derek")
Error: There is no Ws equation in 'WSlit' for Derek.
Type 'wsVal()' to see a list of available species.
The
wsVal()
function only works with some species but also defaults to using metric units and 75th percentile equations. However, it sends the same error message if any one of those three things does not exist inWSlit
which is not particularly useful as the user does not know if the problem is that species does not exist or, for example, the species exists but there is no equation for the 75th percentiles. An example is for Bighead Carp, which exist inWSlit
but only as a 50th percentile equation.The error would be more informative if we checked first to see if the species exists, send a message if it does not, then move on to check the units, send a message if the equation does not exist for those units, and then check the reference percentile, and send a message if that does not exist.