R/change_data.r
calculate_data_units.Rd
Given the sampling arguments that are specified in ..._params
, e.g.,
index_params
, calculate the super set of fleets, years, and data
types that will be needed in the data file of expected values that is
generated by the OM.
calculate_data_units(
index_params = NULL,
lcomp_params = NULL,
agecomp_params = NULL,
calcomp_params = NULL,
mlacomp_params = NULL,
wtatage_params = NULL
)
Named lists containing the arguments for
sample_index()
.
Named lists containing the arguments for
sample_lcomp()
.
Named lists containing the arguments for
sample_agecomp()
.
Named lists containing the arguments for
sample_calcomp()
.
Named lists containing the arguments for
sample_mlacomp()
.
Named lists containing the arguments for
sample_wtatage()
.
A list with the following three elements:
fleets,
years, and
types.
A superset by nature is larger than the individual sets used to create it (unless all sampling arguments are identical), so that the returned list will created some unnecessary combinations. This was done intentionally for simplicity but may be changed later.
See further examples in clean_data and change_data
## Only one fleet
calculate_data_units(lcomp_params = list(fleets = 1, years = c(3, 4, 6)))
#> $fleets
#> [1] 1
#>
#> $years
#> [1] 3 4 6
#>
#> $types
#> [1] "len"
#>
## Add new fleet
morefleets <- calculate_data_units(
lcomp_params = list(fleets = 1, years = c(3, 4, 6)),
agecomp_params = list(fleets = 2, years = 5)
)
## Add length or age if missing and conditional-age-at-length is included
test <- mapply(calculate_data_units,
SIMPLIFY = FALSE,
lcomp_params = list(NULL, list(fleets = 1, years = 1:10)),
agecomp_params = list(NULL, NULL),
MoreArgs = list(calcomp_params = list(fleets = 1, years = 1:10))
)
rm(test)