Convert numeric vector to factor, using quantiles intervals
cut_by_quantile.Rd
Divides the range of a numeric vector by the quantiles provided ('q').
Usage
cut_by_quantile(x, q = seq(0, 1, by = 0.2))
Examples
x <- rnorm(10)
cut_by_quantile(x)
#> [1] (0.0972,0.451] (-1.03,-0.364] (-0.364,0.0972] (0.451,2.22]
#> [5] (0.0972,0.451] (-1.03,-0.364] [-1.76,-1.03] [-1.76,-1.03]
#> [9] (-0.364,0.0972] (0.451,2.22]
#> 5 Levels: [-1.76,-1.03] (-1.03,-0.364] (-0.364,0.0972] ... (0.451,2.22]