mapLevels
produces a map with information on levels and/or internal integer codes. As such can be conveniently used to store level mapping when one needs to work with internal codes of a factor and later transfrorm back to factor or when working with several factors that should have the same levels and therefore the same internal coding.
mapLevels(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...)mapLevels(x) <- value
# S3 method for default
mapLevels(x, codes, sort, drop, combine, ...)
# S3 method for character
mapLevels(x, codes, sort, drop, combine, ...)
# S3 method for factor
mapLevels(x, codes, sort, drop, combine, ...)
# S3 method for list
mapLevels(x, codes, sort, drop, combine, ...)
# S3 method for data.frame
mapLevels(x, codes, sort, drop, combine, ...)
.unlistLevelsMap(x, ind = FALSE)
# S3 method for levelsMap
print(x, ...)
# S3 method for listLevelsMap
print(x, ...)
# S3 method for levelsMap
[(x, i)
# S3 method for listLevelsMap
[(x, i)
is.levelsMap(x)
is.listLevelsMap(x)
.isCharacterMap(x)
as.levelsMap(x, check = TRUE, ...)
as.listLevelsMap(x, check = TRUE)
.checkLevelsMap(x, method)
.checkListLevelsMap(x, method)
# S3 method for levelsMap
c(..., sort = TRUE, recursive = FALSE)
# S3 method for listLevelsMap
c(..., sort = TRUE, recursive = FALSE)
# S3 method for levelsMap
sort(x, decreasing = FALSE, na.last = TRUE, ...)
# S3 method for levelsMap
unique(x, incomparables = FALSE, ...)
mapLevels(x) <- value
# S3 method for default
mapLevels(x) <- value
# S3 method for list
mapLevels(x) <- value
# S3 method for data.frame
mapLevels(x) <- value
object whose levels will be mapped, look into details
boolean, create integer levelsMap (with internal codes) or character levelsMap (with level names)
boolean, create integer levelsMap (with internal codes) or character levelsMap (with level names)
boolean, sort levels of character x
, look into details
boolean, drop unused levels
boolean, combine levels, look into details
additional arguments for sort
levelsMap or listLevelsMap, output of mapLevels
methods or constructed by user, look into details
Gregor Gorjanc
AlphaPart