Bin-methods: Bin methods for discretizing variables

Description Usage Arguments Details Value Examples

Description

Bin is a generic function that works differently depending on the inputs.

Usage

1
Bin(x, y, w, seg, name, ...)

Arguments

x

A numeric or factor variable or a data.frame.

y

A binary, numeric variable with values of 0 and 1 only.

w

An optional numeric vector of positive weights.

seg

An optional segment factor

name

Name of the bin. Automatically provided if binning a data.frame

...

Additional arguments passed on to the Bin method that control discretization. See details for available options

Details

Additional options can be passed to Bin to control the discretization process. These arguments are as follows:

Value

Bin will return various binned objects depending on the arguments provided:

Examples

1
2
3
4
5
6
data(mtcars)
y <- as.integer(mtcars$mpg > 20)
seg <- factor(mtcars$cyl)
Bin(mtcars$disp, y)
Bin(mtcars, y)
Bin(mtcars, y, seg=seg)

Zelazny7/binnr2 documentation built on May 10, 2019, 1:56 a.m.