FSA icon indicating copy to clipboard operation
FSA copied to clipboard

wsVal() fails ungracefully in some situations

Open droglenc opened this issue 4 years ago • 0 comments

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 in WSlit 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 in WSlit but only as a 50th percentile equation.

wsVal("Bighead Carp")
 Error: A Ws equation may not exist given your choices of species, units, and ref.
Please look carefully inside the data(WSlit) data frame.
wsVal("Bighead Carp",ref=50)
       species  units   type ref measure method min.TL      int   slope              source
7 Bighead Carp metric linear  50      TL    RLP    160 -4.65006 2.88934 Lamer et al. (2019)

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.

droglenc avatar Mar 17 '22 03:03 droglenc