Summarize a data frame as binned interpolated percentiles
Source:R/interpolated_quantile.R
binipolate.Rd
Summarize a data frame as binned interpolated percentiles
Examples
binipolate(mtcars, mpg, bin_size = 0.25)
#> # A tibble: 1 × 2
#> probs value
#> <dbl> <dbl>
#> 1 0.5 19.1
binipolate(mtcars, mpg, probs = c(0.25, 0.5, 0.75), bin_size = 0.25)
#> # A tibble: 3 × 2
#> probs value
#> <dbl> <dbl>
#> 1 0.25 15.4
#> 2 0.5 19.1
#> 3 0.75 22.2
binipolate(mtcars, mpg, probs = c(0.25, 0.5, 0.75), bin_size = 0.25, .by = cyl, w = wt)
#> # A tibble: 9 × 3
#> cyl probs value
#> <dbl> <dbl> <dbl>
#> 1 4 0.25 21.9
#> 2 4 0.5 23.9
#> 3 4 0.75 28.3
#> 4 6 0.25 18.0
#> 5 6 0.5 19.5
#> 6 6 0.75 20.6
#> 7 8 0.25 13.0
#> 8 8 0.5 15.2
#> 9 8 0.75 16.1