A specialized version of Extend0()
Source:R/Extend0fromModelMatrixInput.R
Extend0fromModelMatrixInput.Rd
Extend0fromModelMatrixInput()
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
extend0
is set toTRUE
, the data is automatically extended. Additionally,extend0
can be specified as a list, representing thevarGroups
parameter in theExtend0
function. 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
dimVar
input forExtend0()
. If not provided,dimVar
is 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
hierarchical
input toExtend0()
. By default, it is set to the opposite ofavoidHierarchical
whenhierarchies
is not provided. Ifhierarchies
is provided,hierarchical_extend0
is by default set toFALSE
. This parameter allows thehierarchical
input 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 theextend0
parameter and returnsTRUE
orFALSE
, indicating whether the data should be extended.