bcgov / wqbc

An R package for water quality thresholds and index calculation for British Columbia
http://bcgov.github.io/wqbc/
Apache License 2.0
20 stars 9 forks source link

standardize_variables: Use lookup table of parameters rather than text-matching #86

Open stephhazlitt opened 7 years ago

stephhazlitt commented 7 years ago

Need to construct a table matching parameters in rems::ems_paramaters to those in wqbc::limits

limit_name ems_parameter ems_param_code
X X Total 123
X X Dissolved 1234

Then standardize_variables should lookup the limits in wqbc::limits using this table, then output from calc_limits should look like this:

Variable Value LimitName UpperLimit LowerLimit
X Total 7 X 11 2
X Dissolved 6 X 11 2
X Suspended 5 X 11 2
X Foo 42 X NA NA

X Foo was not matched in the lookup table

Then calc_limits should have an argument drop saying whether or not to drop the rows where limits were not able to be calculated - either because it wasn't able to be matched in the lookup table, or the limit was dependent on another variable that was not available.