make.quantiles is a wrapper for quantile replacing the input with calculated values. Unmatched quantiles will return NA in order to match the length of the input vector.
make.quantiles(x, ..., as.factor = FALSE)A quantile representation of the input
Any indeterminate probabilities relative to the input will return NA
sample(900, 20) |> (\(x) data.frame(x = x, q = book.of.features::make.quantiles(x, seq(0, 1, .1), as.factor = TRUE)))()
#> x q
#> 1 83 20%
#> 2 252 40%
#> 3 686 90%
#> 4 142 40%
#> 5 796 100%
#> 6 596 80%
#> 7 661 90%
#> 8 838 100%
#> 9 127 30%
#> 10 7 10%
#> 11 135 30%
#> 12 506 70%
#> 13 6 0%
#> 14 389 50%
#> 15 524 70%
#> 16 264 50%
#> 17 395 60%
#> 18 32 20%
#> 19 400 60%
#> 20 587 80%
sample(900, 20) |> (\(x) data.frame(x = x, q = book.of.features::make.quantiles(x, seq(0, 1, .1), as.factor = FALSE)))()
#> x q
#> 1 866 873.0
#> 2 458 462.8
#> 3 139 179.9
#> 4 8 8.0
#> 5 722 736.4
#> 6 470 531.5
#> 7 374 413.5
#> 8 453 462.8
#> 9 79 130.6
#> 10 197 273.4
#> 11 668 693.8
#> 12 140 179.9
#> 13 473 531.5
#> 14 285 413.5
#> 15 687 693.8
#> 16 28 73.9
#> 17 721 736.4
#> 18 97 130.6
#> 19 873 873.0
#> 20 256 273.4