This function summarizes an arbitrary bin column, with respect to its original column. Can be used to summarize bins created from any package, or any arbitrary categorical column paired with a numeric column.
numeric_summary(mdb, original_col, bucket_col)
a data frame
original numeric column
columns of bins
a tibble
iris %>%
numeric_summary(original_col = Sepal.Length, bucket_col = Species)
#> # A tibble: 3 × 11
#> Species .min .mean .max .count .uniques relative_value .sum .med .sd
#> <fct> <dbl> <dbl> <dbl> <int> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 virginica 4.9 6.59 7.9 50 21 100 329. 6.5 0.636
#> 2 versicolor 4.9 5.94 7 50 21 90.1 297. 5.9 0.516
#> 3 setosa 4.3 5.01 5.8 50 15 76.0 250. 5 0.352
#> # … with 1 more variable: width <dbl>