combine_levels {tern} | R Documentation |
Combine factor levels
Description
Combine specified old factor Levels in a single new level.
Usage
combine_levels(x, levels, new_level = paste(levels, collapse = "/"))
Arguments
x |
( |
levels |
( |
new_level |
( |
Value
A factor
with the new levels.
Examples
x <- factor(letters[1:5], levels = letters[5:1])
combine_levels(x, levels = c("a", "b"))
combine_levels(x, c("e", "b"))
[Package tern version 0.9.5 Index]