powered by
Using base/stats functions cut() and quantile().
quantile_cut( x, groups, y = NULL, na.rm = TRUE, group.names = NULL, ordered.f = FALSE, inc.outs = FALSE, detail.list = FALSE )
vector or list with vector and details (length 2)
Variable to cut.
Number of groups.
alternative vector to draw quantile cuts from. Limits has to be within x. Default is NULL.
Remove NA's. Default is TRUE.
Names of groups to split to. Default is NULL, giving intervals as names.
Set resulting vector as ordered. Default is FALSE.
Flag to include min(x) and max(x) as borders in case of y!=NULL.
flag to include details or not
aa <- as.numeric(sample(1:1000,2000,replace = TRUE)) x <- 1:450 y <- 6:750 summary(quantile_cut(aa,groups=4,detail.list=FALSE)) ## Cuts quartiles
Run the code above in your browser using DataLab