| combineVariables {inTextSummaryTable} | R Documentation |
Create a data.frame combining a set of records from same or multiple variables.
Description
This typically converts the data from a wide to a long format. For each variable, a subset of interest based on a condition can be specified.
Usage
combineVariables(
data,
paramsList,
newVar,
labelVars = NULL,
fctTest = "==",
includeAll = FALSE,
labelAll = "Any"
)
Arguments
data |
Data.frame with dataset to consider for the summary table. |
paramsList |
nested list of parameters,
specifying how the records of interest should be selected.
|
newVar |
String with name of new variable to construct. |
labelVars |
(optional) Named character vector with label for
the row, column variable(s) or variable(s) to summarize. |
fctTest |
Default function to use to compare |
includeAll |
Logical, if TRUE (FALSE by default) include also the entire data as an additional subgroup. |
labelAll |
String of group label for the entire data in case |
Value
Data.frame with records from data extracted based on
the different conditions specified in paramsList.
This data.frame contains an additional variable
(labelled based on newVar) mentioning the
specific condition for which the record was extracted
(based label, labelExtra, labelVars).
This variable is a factor whose levels are ordered based on the order
of the condition specified in paramsList.
Author(s)
Laure Cougnaud