Skip to contents

This function removes from a data.frame factors that have too many levels.

Usage

remove_factors_with_too_many_levels(df, maxlevels = 20)

Arguments

df

data.frame

maxlevels

(integer) maximum number of levels for factors

Value

df with factors with more than maxlevels levels removed

Examples

df <- df |> remove_factors_with_too_many_levels()
#> [1] "Removed factors with more than 20 levels:"
#> character(0)