Description Usage Format Details Methods
The SMGFactory
applies the Factory pattern for creating a set of
SummaryMeasureGenerators, based on the needed variables. This eases the
creation of summary measures as the user of this package only needs to
specify the correct column names. The factory parses the formulas used and
generates summary measures accordingly.
1 |
An object of class R6ClassGenerator
of length 24.
TODO: In its current form the SMG Factory is a rather static class. It is currently hard to extend this function with more SMGS without changing the actual package code. This should be improved.
initialize(candidate_smgs)
Creates a new SMG factory
@param candidate_smgs list UNUSED. This argument should be used to specify a list of possible SMGs.
fabricate(relevantVariables, ...)
Fabricates the actual SMG's. Given a list of RelevantVariable
s all
covariates are selected and merged. These are used as a basis for
selecting the needed variables in the dataframe. The column names need to be specified as follows:
- just the variable name: uses the SMG.Latest.Entry
class
to include the contemporaneous variables.
- the variable name\_lag\_the lag: uses the SMG.Lag
class
to include the lagged variables.
- the variable name\_mean: uses the SMG.Mean
class to
include the running mean for this variable.
@param relevantVariables = a list of RelevantVariable
objects, from
which the X variables are selected.
@param ... = data to get passed to the SMG
fabricate(relevantVariables, ...)
Fabricates the actual SMG's. Given a list of RelevantVariable
s all
covariates are selected and merged. These are used as a basis for
selecting the needed variables in the dataframe.
@param relevantVariables list a list of RelevantVariable
objects, from which the X variables are selected.
@param ... the data to get passed to the SMG.
@return SummaryMeasureGenerator with the correct SMGs.
get_candidate_smgs
Active method. Returns the candidate SummaryMeasureGenerator
s provided on initialization.
@return list the list of candidate_smgs
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.