drop_original_cols: Drop Original Cols

Description Usage Arguments Value Examples

View source: R/drop_original_cols.R

Description

Drops the original column from the dataframe once bins are made. Throws an error if the same column has multiple bin cols.

Usage

1
drop_original_cols(.data, ..., restore_names = FALSE)

Arguments

.data

dataframe output from bin_cols

...

tidyselect. default chooses all cols created from binning

restore_names

Logical, default FALSE. rename the binned cols with the original column names?

Value

dataframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
iris %>%
 bin_cols(Sepal.Length) %>%
 bin_cols(Sepal.Width, pretty_labels = TRUE) -> iris1

iris1

iris1 %>%
 drop_original_cols(restore_names = TRUE)

iris1 %>%
 drop_original_cols(restore_names = FALSE)

tidybins documentation built on Oct. 14, 2021, 5:22 p.m.