group_levels {crtests}R Documentation

Group infrequent levels in data, either a factor or a data.frame

Description

Group infrequent levels in data, either a factor or a data.frame

Group infrequent factor levels in a data.frame

Group infrequent factor levels in a list of data.frames

Usage

group_levels(data, maximum_levels = 32)

## S3 method for class 'factor'
group_levels(data, maximum_levels = 32)

## S3 method for class 'data.frame'
group_levels(data, maximum_levels = 32)

## S3 method for class 'list'
group_levels(data, maximum_levels = 32)

Arguments

data

A data.frame or factor. In the first case, group_levels is applied to each factor in the data.frame.

maximum_levels

Numeric. The maximum number of levels allowed per factor

Value

A factor with at most maximum_levels, or a data.frame where each factor matches that requirement

Methods (by class)


[Package crtests version 0.2.1 Index]