Description Usage Arguments Value Examples
View source: R/statistic_functions.R
manage the conversion and sat label to qualitative into a data.frame based on dictionnary.
1 2 3 4 5 6 7 8 | setLabelToFactorLevels(
data,
factorLevelsLabel,
varIndex = 1,
levelsIndex = 2,
labelIndex = 3,
levelsThreesholdCheck = 5
)
|
data |
a data.frame containing qualitative variable witch need to be labelised. |
factorLevelsLabel |
a data.frame containing variable names / modality as digit / label of the modality. |
varIndex |
a numeric vector of length one, containing the index of the variable column. |
levelsIndex |
a numeric vector of length one, dontaining the index of the levels column. |
labelIndex |
a numeric vector of length one, containing the index of the labels column. |
levelsThreesholdCheck |
a numeric vector of length one, containing the disctinct number value threeshold to check to evaluate if all factor variable are listed in the factorLevelsLabel table |
a data.frame with qualitative variable in the factorLevelsLabel convert as factor with clean label
1 2 3 4 5 6 | data <- data.frame(X1 = c(0, 1, 2, 1, 2, 1, 2),
X2 = c(0, 1, 0, 1, 1, 0, 0))
labelTable <- data.frame(VARIABLE = c("X2", "X2"),
MODALITY = c(0, 1),
LABEL = c("Male", "Female"))
data <- setLabelToFactorLevels(data, labelTable)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.