R/Report.R
aggregateBaselineDataOneTableSingleFunction.Rd
Function to aggregate baseline data
aggregateBaselineDataOneTableSingleFunction(
stoxData,
subTable = character(),
TargetVariable,
ReportFunction = getReportFunctions(),
GroupingVariables = character(),
InformationVariables = character(),
na.rm = FALSE,
padWithZerosOn = character(),
Specification = list(),
uniqueGroupingVariablesToKeep = NULL
)
Output from any StoX function.
The name of the sub table to aggregate on, if stoxData
is a list of tables.
The variable to report.
The name of a function to report the Baseline process output by. This must be a function returning a single value. See ReportFunctions
for implemented funcitons.
The variables to report by. For most applications GroupingVariables
should include "Survey" and "SpeciesCategory", unless the user needs to sum over all Survey or SpeciesCategory.
Variables to include as columns to the end of the report table. These cannot have more unique combinations than the GroupingVariables
.
Used in the function specified by ReportFunction
.
Character vector giving the variables for which missing values should be padded with zeros. This is used particularly for bootstrapping, where a fish length missing in a bootstrap run should be considered as samples with zero individuals, and not missing, so that summary statistics end up taking all bootstrap replicates into account (if not a mean would be overestimated). When padWithZerosOn has positive length, padding with zeros is applied to this variable and to the GroupingVariables
.
A named list of specification parameters used in the ReportFunction
.
A data.table holding unique combinations to extract from the data, used by RstoxFramework::ReportBootstrap() to discard combinations of the grouping variables what do not exist in the data. Such combinations are introduced with the CJ operation when padWithZerosOn is given.
An aggregated version of the input stoxData
.