bin: Bin numeric columns.

Description Usage Arguments Examples

Description

Bin numeric columns.

Usage

1
bin(vars = numerics, breaks = 10)

Arguments

vars

Function or formula that returns selected columns from a data.frame. Alternatively, character vector of column names.

breaks

Either an integer representing the number of bins or a vector of break points.

Examples

1
2
3
4
5
6
df <- data.frame(A=rep("a", 100), B=rnorm(100))
prep <- bin()
prep$fit(df)
prep$transform(df)
# or more succintly
prep$fit_transform(df)

rtsho/preprocessr documentation built on May 29, 2019, 8:58 a.m.