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

Remove {knitr} from main code #96

Open kellijohnson-NOAA opened 1 year ago

kellijohnson-NOAA commented 1 year ago

{knitr} is a suggests not an import and yet this table function in checkLenAge() uses {knitr}. I will try to find some other way to summarize the information.

https://github.com/pfmc-assessments/PacFIN.Utilities/blob/a067169fbca82ca51abc668a58b748a51620eb0d/R/checkLenAge.R#L163

iantaylor-NOAA commented 1 year ago

I didn't realize that PacFIN.Utilities::checkLenAge() existed because the example {PacFIN.Utilities} script that @chantelwetzel-noaa provided uses nwfscSurvey::est_growth() to estimate von Bertalanffy growth curve and flag outliers (adapted for Petrale here: https://github.com/pfmc-assessments/petrale/blob/main/R/process_pacfin_bds.R#L149-L167).

Therefore, one potential solution would be to just remove PacFIN.Utilities::checkLenAge() (or initially deprecate but not require {knitr}) and rely on the {nwfscSurvey} version instead, similar to the plan proposed in https://github.com/pfmc-assessments/nwfscSurvey/issues/110 for weight-length estimation.

chantelwetzel-noaa commented 1 year ago

Given that we are mid-assessment season, I worried about getting rid of the PacFIN.Utilities::checkLenAge() could interrupt users workflow so opted to have duplication for the time being. However, if we wanted to clean things up we could call the nwfscSurvey::est_growth() from within the PacFIN.Utilities::checkLenAge().

kellijohnson-NOAA commented 1 year ago

I will make sure to keep it ... and it already calls the same fit function that nwfscSurvey::est_growth() calls so basically the only differences are formatting of the output.