refactorCategorical {RMixtCompUtilities} | R Documentation |
Rename a categorical value
Description
Rename a categorical value
Usage
refactorCategorical(
data,
oldCateg = unique(data),
newCateg = seq_along(oldCateg)
)
Arguments
data |
matrix/data.frame/vector containing the data |
oldCateg |
vector containing categories to change |
newCateg |
vector containing new categorical values |
Value
Data with new categorical values
Author(s)
Quentin Grimonprez
Examples
dat <- c("single", "married", "married", "divorced", "single")
refactorCategorical(dat, c("single", "married", "divorced"), 1:3)
[Package RMixtCompUtilities version 4.1.6 Index]