Repository navigation
Feature(#113): add calc_condition function - #122
Conversation
…and NOAA-EDAB/lengthweight
…com/NOAA-EDAB/survdat into feature/i113-add-condition-function
…ht parameter to condition function with option to use Wigley or survdat LWs
|
@andybeet I ran |
andybeet
left a comment
There was a problem hiding this comment.
As per our conversation
Once you add the data docs to the /R folder and add create_<dataset>.r to data-raw please re-request a review.
I'll take a look at those merge conflicts. I think that is either from an earlier issue we didnt address or maybe be are using different versions of roxygen. i have 8.1.0
atyrell3
left a comment
There was a problem hiding this comment.
Lines 34-44 need to be removed as the output parameter is no longer used so it's causing the function to break if by_sex or length_breaks aren't NULL.
I also suggest renaming column n to nYears.
Other than that, looks good!
…nventions. Ensure both EPUstrata and Wigley_LW are tibbles
…ata-raw for EPUstrata
…r length_break does not = NULL, old parameter from NEesp2
@andybeet Blueback herring and northern searobin are present in the survdat length weights but absent from Wigley. Should this go into the documentation in |
…by (='EPU'). The function will default to SOE indicator output
|
@stephanie-owen i think the species information should be with the data documentation rather than the function documentation. However, we could include a |
For re-reviewAddressing the following suggested issues. All blocking issues and non-blocking issues in bold have been addressed in recent commits. Non-blocking issues in regular text could be added in subsequent versioning of the package. Reviewer instructions at the bottom of issues list. DocumentationAddressed all of the below documentation issues.
Function
Defaulted
3. issue(non-blocking): no longer a need for
5. issue(non-blocking): should be explicit in the left_join. eg add General
If we want to do this in the future, should add some requirements for columns and formatting for users using their own length-weights to ensure their data still works within the function.
Added a Reviewer instructions
and
|
atyrell3
left a comment
There was a problem hiding this comment.
The calc_condition helpfile wasn't updated, so I reknit it with roxygen. I also hyperlinked the SOE_workflows reference in EPUstrata.
Function works as expected, good to go!
…scripts, inherited params, updated some param definitions, updated example section
…required line in DESCRIPTION
Co-authored-by: Brandon Beltz - NOAA Affiliate <136381970+BBeltz1@users.noreply.github.com>
Co-authored-by: Brandon Beltz - NOAA Affiliate <136381970+BBeltz1@users.noreply.github.com>
Small documentation changes addressing `calc_condition` + data sets
For re-reviewMerged PR 132 into this branch. Branch was created to modify documentation to correspond to similar functions and datasets in Reviewer InstructionsPull latest changes |
Justification
Migration of condition calculation code from NEesp2 to survdat, as condition already incorporates multiple survdat functions and data. Allows for more streamlined applications in the SOE and ESPs with other similar survdat functions.
Fixes #113
Types of changes
Further comments
The survdat function (in comparison to previous NEesp2 function) has arguments for 'lengthweight' and 'aggregate_by', which allows the user to use either the LW parameters from Wigley et al. (2003) or from
survdat::get_length_weightand the spatial scale either by strata or EPU.In addition to
calc_condition.R, I have added datasets for the strata/EPU key (data/EPUstrata.rda) and Wigley length weights(data/Wigley_LW.rda)to the package. Data documentation forsurvdat::Wigley_LWis included as an R script indata-raw. If there is a better place to house this documentation please let me know.Reviewer instructions
Run the following in this branch:
feature/i113-add-condition-function. May need to rundevtools::load_all()prior to the condition function.Connect to channel using
channel <- dbutils::connect_to_database(server = "", uid = "")Pull survey data using
data <- survdat::get_survdat_data(channel, getBio = TRUE, getLengths = TRUE)Test the calc_condition function using the following two calls. These test for both strata and EPU and Wigley and survdat options:
calc_condition(channel = channel, surveyData=data$survdat, lengthweight = "Wigley", aggregate_by = "EPU", by_sex = FALSE, length_break = NULL)and
calc_condition(channel = channel, surveyData=data$survdat, lengthweight = "survdat", aggregate_by = "strata", by_sex = FALSE, length_break = NULL)R/calc_condition.Randdata-raw/Wigley_LW_documentation.Rfor accuracy.Formatting
This repo contains an
air.tomlfile that automatically formats code to a set of standards.It is preferred that contributors and reviewers install the Air formatting tool.
Code submitted in this pull request will be automatically checked for correct formatting.