View source: R/addCLtoLowerCS.R
addCLtoLowerCS | R Documentation |
This function adds data from a CL
table in an RDBESDataObject
to a
BV or FM table. It combines information from the CS
and CL
tables and
calculates aggregate statistics such as the sum of the specified fields in the CL
table.
addCLtoLowerCS(
rdbes,
strataListCS,
strataListCL,
combineStrata = T,
lowerHierarchy = "C",
CLfields = c("CLoffWeight"),
verbose = FALSE
)
rdbes |
An object of class |
strataListCS |
A named list of filter criteria for subsetting the |
strataListCL |
A named list of filter criteria for subsetting the |
combineStrata |
Logical, if |
lowerHierarchy |
A character string specifying the level of the lower hierarchy table to which the CL data will be added. Currently, only "C" is supported ie BV data only. |
CLfields |
A character vector of field names from the |
verbose |
Logical, if |
The function first subsets the biological data in the RDBESDataObject
based on the criteria in strataListCS
. It then retrieves
the corresponding CL
data based on the criteria in strataListCL
, sums the fields specified in CLfields
, and adds them as new columns
to the biological data. If combineStrata
is TRUE
, strata columns from the CS
data are collapsed using a vertical bar (|
). The function
currently supports only biological data at the "C" hierarchy level.
A data.table containing the biological data from the lower hierarchy with added strata information from the CL
table and
the sum of the specified fields from the CL
data.
getLowerTableSubsets
, upperTblData
## Not run:
strataListCS <- list(LEarea="27.3.d.28.1",
LEmetier6 = "OTM_SPF_16-31_0_0",
TEstratumName = month.name[1:3],
SAspeCodeFAO = "SPR")
strataListCL <- list(CLarea="27.3.d.28.1",
CLquar = 1,
CLmetier6 = "OTM_SPF_16-31_0_0",
CLspecFAO = "SPR")
biolCL <- addCLtoLowerCS(rdbesObject, strataListCS, strataListCL,
combineStrata = TRUE,
lowerHierarchy = "C",
CLfields = c("CLoffWeight"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.