DefineSummariesClass: R6 class for parsing and evaluating user-specified summary measures (in exprs_list
)
Description
This R6 class that inherits from
can parse and evaluate (given the input data frame) the summary measures defined by functions
def.sW
and def.sA
.
The object of this class is generally instantiated by calling functions def.sA
or def.sW
.
The summary expressions (stored in exprs_list
) are evaluated in the environment of the input data.frame.
Note that the evaluation results of the summary measures are never stored inside this class,
data can be stored only inside DatNet
and DatNet.sWsA
R6 classes.
Usage
DefineSummariesClass
Methods
new(type)
- Instantiate a new object of class
DefineSummariesClass
by providing a type, "sW"
or "sA"
. set.new.exprs(exprs_list)
- Sets the internal summary measure expressions to the list provided in
exprs_list
. add.new.exprs(NewSummaries)
- Adds new internal summary measure expressions to the existing ones,
NewSummaries
must be an object of class DefineSummariesClass
(to enable Object1 + Object2
syntax). itemremove.expr(SummaryName)
Remove expression by name (for removing duplicate 'nF' expressions for repeated calls with def.sW()+def.sW()).
eval.nodeforms(data.df, netind_cl)
- Evaluate the expressions one by one, standardize all names according to one naming
convention (described in
def.sW
), cbind
ing results together into one output matrix. data.df
is the input
data.frame and netind_cl
is the input network stored in an object of class NetIndClass
. df.names(data.df)
- List of variables in the input data
data.df
gets assigned to a special
variable (ANCHOR_ALLVARNMS_VECTOR_0
).
Details
type
- Type of the summary measure, sW
or sA
, determined by the calling functions def.sW
or def.sA
.
exprs_list
- Deparsed list of summary expressions (as strings).
new_expr_names
- The summary measure names, if none were provided by the user these will be
evaluated on the basis of variable names used in the summary expression itself.
sVar.names.map
- Named list that maps the user specified summary measure names to the corresponding matrix column names
from the summary measure evaluation result.