View source: R/computeSummaryStatisticsTable.R
convertVarToFactorWithOrder | R Documentation |
Convert a variable to a factor with levels in specified order.
convertVarToFactorWithOrder(
data,
var,
otherVars = NULL,
colVar = NULL,
colTotalLab = "Total",
method = c("auto", "alphabetical", "total"),
totalFilterFct = NULL,
totalVar = "statN",
catLast = NULL
)
data |
Data.frame with dataset to consider for the summary table. |
var |
String with variable of |
otherVars |
Character vector with other variable(s) of |
colVar |
Character vector with variable(s) to be included in columns.
If multiple variables are specified, the variables should
be sorted in hierarchical order,
and are included in multi-columns layout. |
colTotalLab |
String, label for the total column 'Total' by default. |
method |
Ordering method to use, either:
|
totalFilterFct |
(optional) Function which returns a subset of the data of interest, to filter the total data considered for the ordering. |
totalVar |
String with variable of |
catLast |
String with last category (if any). Set to NULL if no specific category should be included as last element. |
Factor var
variable of data
with specified order.
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.