Closed lee-qi closed 3 years ago
Thanks @lee-qi for reporting. I have access to the file, but can you share your call to cleanPacFIN() or are you just using the default settings for all parameters?
Ah good point. I used the code from the last assessment cycle, so that might have been why?
Pdata <- cleanPacFIN(Pdata = Pdat,
keep_gears = c("HKL", "POT", "TWL"),
keep_sample_type = c("", "C", "M"),
keep_sample_method = "R",
keep_length_type = c("", "A", "F"), # Double check this
CLEAN = FALSE,
spp = "sablefish")
I filtered the .RData object provided for this year using the code you have above, except I changed CLEAN = TRUE
and I am getting samples with a length_cm > 0 in 1978.
Right, thanks for checking that. Historically though that time series extended back to 1970. Before I updated the R package on my local machine, the same code had given those 1970 lengths back in March.
BINGO -- they have no expanded weight, so even if you change your call to cleanPacFIN to include keep_length_type = c("U", ...) they are still cleaned. Look at EXP_WT. These should not be included because we have no way of knowing how big the tow was to expand the sample, whereas previously I guessed a weight based on surrounding years.
Ah, perfect. So feature, and not a bug! Awesome, thanks for talking through this!
cleanPacFIN()
resulted in early years of the sablefish fishery length comp data to be filtered out (i.e. thelength
column is shown as NA even though there is a value forFISH_LENGTH
). I dug a tiny bit deeper into it, and it might be due to the fact thatFISH_LENGTH_TYPE
was U, but am unsure. Any chance this is a feature and not a bug?It basically resulted in there being no length composition data for the sablefish fisheries from 1970-1978, when those were historically present in the assessment sensitivity run. Happy to share files as needed.