Re: [R] calculating quintile values of numeric data? Alexandros Kouretsis

2019-01-23 Thread Alexandros Kouretsis
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

[R] RW: Banner using R (Alexandros Kouretsis)

2019-01-17 Thread Alexandros Kouretsis
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'