Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(tidybins) suppressPackageStartupMessages(library(dplyr))
Binning by value is the only original binning method implemented in this package. It is inspired by the case in marketing when accounts need to be binned by their sales. For example, creating 10 bins, where each bin represent 10% of all market sales. The first bin contains the highest sales accounts, thus has the small total number of accounts, whereas the last bin contains the smallest sales accounts, thus requiring the most number of accounts per bin to reach 10% of the market sales.
tibble::tibble(SALES = as.integer(rnorm(1000L, mean = 10000L, sd = 3000))) -> sales_data sales_data %>% bin_cols(SALES, bin_type = "value") -> sales_data1 sales_data1
Notice that the sum is equal across bins.
sales_data1 %>% bin_summary() %>% print(width = Inf)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.