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

clean_wqdata should keep only water quality data #84

Closed stephhazlitt closed 6 years ago

stephhazlitt commented 7 years ago

Dependent on completion of #83. Keep rows where SAMPLE_STATE == c("Fresh Water", "Ground Water", "Wastewater", "Marine Water")

ateucher commented 6 years ago

@KaPrz would this set of SAMPLE_STATEs make sense to you or too restrictive? You mentioned you were working on sediment as well...

KaPrz commented 6 years ago

@ateucher it wouldn't make sense to retain sediment when doing any of the analysis (like calculating guidelines) or for the WQ Index, but it is nice to retain sediment through at least tidy_ems_data function.

ateucher commented 6 years ago

Ok, thanks @KaPrz - so tidy_ems_data() will keep all SAMPLE_STATEs, but clean_wq_data() will keep only the above list.

ateucher commented 6 years ago

I think this is irrelevant for data from EC as it is only wq data already...

KaPrz commented 6 years ago

@ateucher I think it would be good to be able to use standardize_wqdata on sediment data as well. Pending some investigation into parameter names and codes.

ateucher commented 6 years ago

I think I'm going to close this one and leave it up to the user to filter the data before using clean_wq_data() etc. That way the user is : a) not constrained to what they can use it on, and b) forced to know exactly what data they're putting in.

So you can then

library(dplyr)

sed_data <- filter(my_data, SAMPLE_STATE == "Fresh Water Sediment")
clean_wq_data(sed_data)

# OR 

fw_data <- filter(my_data, SAMPLE_STATE == "Fresh Water")
clean_wq_data(fw_data)

etc.