data
, either a factor or a data.framedata
, either a factor or a data.frameGroup infrequent factor levels in a data.frame
Group infrequent factor levels in a list of data.frames
group_levels(data, maximum_levels = 32)
"group_levels"(data, maximum_levels = 32)
"group_levels"(data, maximum_levels = 32)
"group_levels"(data, maximum_levels = 32)
group_levels
is applied to each factor in the data.frame.maximum_levels
, or a data.frame where each factor matches that requirement
factor
: Group infrequent levels in a factor. Takes a factor, and if that factor has more than 'maximum_levels', it makes a table of level frequencies. The top (maximum_levels-1) are left unchanged, all less frequent levels are grouped into the level "other". data.frame
: Takes a data.frame, and applies group_levels.factor to each column list
: Takes a list of data.frames and applies group_levels.data.frame
to each