
A specialized version of Extend0()
Source:R/Extend0fromModelMatrixInput.R
Extend0fromModelMatrixInput.RdExtend0fromModelMatrixInput() is a specialized function that extends the input data based on the provided parameters.
It is designed specifically to work with input to ModelMatrix().
Usage
Extend0fromModelMatrixInput(
data,
freqName,
hierarchies,
formula,
dimVar,
extend0,
dVar = NULL,
avoidHierarchical = FALSE,
hierarchical_extend0 = !avoidHierarchical & is.null(hierarchies),
...
)
IsExtend0(extend0)Arguments
- data
Input data frame
- freqName
Name of (existing) frequency variable
- hierarchies
List of hierarchies, which can be converted by
AutoHierarchies. Thus, the variables can also be coded by"rowFactor"or"", which correspond to using the categories in the data.- formula
A model formula
- dimVar
The main dimensional variables and additional aggregating variables. This parameter can be useful when hierarchies and formula are unspecified.
- extend0
When
extend0is set toTRUE, the data is automatically extended. Additionally,extend0can be specified as a list, representing thevarGroupsparameter in theExtend0function. Can also be set to"all"which means that input codes in hierarchies are considered in addition to those in data.- dVar
Optional. Specifies the
dimVarinput forExtend0(). If not provided,dimVaris calculated by theNamesFromModelMatrixInput()function.- avoidHierarchical
Parameter passed to
Formula2ModelMatrix()viaModelMatrix(). The default value (FALSE) is the same as in the receiving function.- hierarchical_extend0
Specifies the
hierarchicalinput toExtend0(). By default, it is set to the opposite ofavoidHierarchicalwhenhierarchiesis not provided. Ifhierarchiesis provided,hierarchical_extend0is by default set toFALSE. This parameter allows thehierarchicalinput toExtend0()to be specified manually, independent of the input provided toModelMatrix().- ...
Further arguments to underlying functions.
Details
Extend0fromModelMatrixInput(): The main function that processes and extends input data according to the specified parameters.IsExtend0(): A helper function that evaluates theextend0parameter and returnsTRUEorFALSE, indicating whether the data should be extended.