rbin_manual: Manual binning

View source: R/rbin-manual.R

rbin_manualR Documentation

Manual binning

Description

Bin continuous data manually.

Usage

rbin_manual(
  data = NULL,
  response = NULL,
  predictor = NULL,
  cut_points = NULL,
  include_na = TRUE
)

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

Arguments

data

A data.frame or tibble.

response

Response variable.

predictor

Predictor variable.

cut_points

Cut points for binning.

include_na

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

x

An object of class rbin_manual.

print_plot

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

...

further arguments passed to or from other methods.

Details

Specify the upper open interval for each bin. 'rbin' follows the left closed and right open interval. If you want to create_bins 10 bins, the app will show you only 9 input boxes. The interval for the 10th bin is automatically computed. For example, if you want the first bin to have all the values between the minimum and including 36, then you will enter the value 37.

Value

A tibble.

Examples

bins <- rbin_manual(mbank, y, age, c(29, 31, 34, 36, 39, 42, 46, 51, 56))
bins

# plot
plot(bins)


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