Answers for "summarize dplyr"

R
0

dplyr group by intervals of 3

d %>% mutate( ints = cut(v1 ,breaks = 11)) %>% 
   group_by(ints) %>% 
   summarise( mean.v2 = mean(v2) , mean.v3 = mean(v3) )
Posted by: Guest on May-15-2020
0

dplyr average columns

library(dplyr)
mutate(df, IVMean = rowMeans(select(., starts_with("IV")), na.rm = TRUE))
Posted by: Guest on August-07-2020

Code answers related to "summarize dplyr"

Browse Popular Code Answers by Language