I have this code below. I'm trying to use quantiles and then subset by groups (years, of which there are two). I think I can do this with dplyr
, but it is not working:
Claims6 %>%
group_by(year) %>%
summarise(ranker = quantile(Expense, prob = c(.10, .30, .50, .80)))
You can use the
do
function for problems like this. I generated some data for you to test this out.