tbl_cut_variables: Create Cut Bins from a Numeric Variable

View source: R/binning.R

tbl_cut_variablesR Documentation

Create Cut Bins from a Numeric Variable

Description

Create Cut Bins from a Numeric Variable

Usage

tbl_cut_variables(
  data,
  variables = NULL,
  breaks = NULL,
  remove_original_variables = F,
  override_labels = NULL,
  is_ordered_factor = T,
  digit_label = 10,
  include.lowest = T,
  right = T
)

Arguments

variables

vector of variable names

breaks

if a a single number the number of breaks or a numeric vector with the breaks

right

Examples


library(ggplot2)
library(asbtools)

tbl_cut_variables(data = diamonds, variables = c("price", "table"), breaks = 10)

tbl_cut_variables(data = diamonds, breaks = c(0, 1000, 5000, 15000, 20000), variable = "price", right = F, include.lowest = F) %>% count(price_0005_cut_bins_0_to_20000)



abresler/asbtools documentation built on July 28, 2022, 11:04 p.m.