cut can do the job
q_prob <- seq(0, 1, 0.2)
cut(x, breaks = quantile(x, probs = q_prob), include.lowest = T , labels =
1:5)
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.e
This might be slightly tricky. You can use factor levels and table to take
into account that B is missing from the third column. Just introducing
dplyr library for piping.
library(dplyr)
Data <- data.frame(v1 = c('A', 'B' ,'B' ,'A', 'B'), v2 = c('A', 'B', 'A',
'A', 'B'), v3 = c('A', 'A', 'A', 'A'
2 matches
Mail list logo