setLevels: Sets the categories of a dataset given a sample

Description Usage Arguments Author(s) Examples

View source: R/setLevels.R

Description

Any category not included in level_values, will be classified as other_name, if the provided level_values is a factor type, it will use the levles(level_values) as the list of categoryes

Usage

1
setLevels(vector, level_values, other_name = "other")

Arguments

vector

vector with character values

level_values

sample with avivable categories

category

for the "other" category

Author(s)

Daniel Fischer

Examples

1
2
vector = sample(letters[1:10],100,replace = T)
limitLevels(vector,c("a","b","b"))

danielfm123/dftools documentation built on July 17, 2021, 1 p.m.