rbin_equal_length: Equal length binning

View source: R/rbin-equal-length.R

rbin_equal_lengthR Documentation

Equal length binning

Description

Bin continuous data using the equal length binning method.

Usage

rbin_equal_length(
  data = NULL,
  response = NULL,
  predictor = NULL,
  bins = 10,
  include_na = TRUE
)

## S3 method for class 'rbin_equal_length'
plot(x, print_plot = TRUE, ...)

Arguments

data

A data.frame or tibble.

response

Response variable.

predictor

Predictor variable.

bins

Number of bins.

include_na

logical; if TRUE, a separate bin is created for missing values.

x

An object of class rbin_equal_length.

print_plot

logical; if TRUE, prints the plot else returns a plot object.

...

further arguments passed to or from other methods.

Value

A tibble.

Examples

bins <- rbin_equal_length(mbank, y, age, 10)
bins

# plot
plot(bins)



rsquaredacademy/rbin documentation built on June 3, 2023, 6:07 p.m.