leppott / MBSStools

Suite of tools for data manipulation and calculations for Maryland DNR MBSS program.
https://leppott.github.io/MBSStools/
GNU General Public License v3.0
3 stars 3 forks source link

Change levels of Exclude for consistency with database export #25

Closed ashtonmj closed 5 years ago

ashtonmj commented 5 years ago

Is your feature request related to a problem? Please describe. Benthic macroinvertebrate sample database populates a factor to identify non-unique taxon (EXCLUDE) with levels "TRUE" and "FALSE". MBSStools metric.values.R sets levels of Exclude as "Y" and null. This has created problems reading data in this column when there are long strings of null values and currently requires additional tidying that is not required.

Describe the solution you'd like Change factor for EXCLUDE from "Y" to "TRUE" when the row is a non-unique taxon to establish consistency with level used in the benthic sample database. This change should be applied in the following lines of metric.values.R

212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 226, 245, 246, 247, 255, 256, 257, 258, 259, 277, 278, 279, 280, 281, 289, 290, 291, 295, 296, 297 (twice), 313, and 439

Describe alternatives you've considered We have currently made these changes with additional, personal lines of code or directly in flat files, which is not desired.

leppott commented 5 years ago

Update package data for Benthos. Fish IBI doesn't use "Exclude" field.

Update data_raw\ProcessData scripts.

Convert field to Logical and TRUE/FALSE rather than Y and "".

devtools::use_data() deprecated. use usethis::use_data().

leppott commented 5 years ago

metric.values.R function

EXCLUDE!="Y" to EXCLUDE!=TRUE

Use search and replace.

leppott commented 5 years ago

Example code for metric.value update myMetrics to use "MetricName.Other" not "Metric". Otherwise get an error.

Correct in metric.scores examples.