pfmc-assessments / PacFIN.Utilities

R code to manipulate data from the PacFIN database for assessments
http://pfmc-assessments.github.io/PacFIN.Utilities
Other
7 stars 1 forks source link

cleanPacFIN incorrectly removing all data #40

Closed chantelwetzel-noaa closed 3 years ago

chantelwetzel-noaa commented 3 years ago

https://github.com/nwfsc-assess/PacFIN.Utilities/blob/eae799217697406a3af0e95b6b9db80b60afc3ba/R/cleanPacFIN.R#L337

@kellijohnson-NOAA I tried testing out this function using the example data in the package. When CLEAN = TRUE all record were being removed. I think I traced it back to this line where I think the check should be:

ifelse(keep_missing_length, TRUE, !is.na(Pdata$length))

rather than

ifelse(keep_missing_length, TRUE, is.na(Pdata$length))

I wanted to double check that I am understanding the issue correctly prior to pushing the fix.