0

I am trying to calculate mean value for all columns in a dataframe using dplyr. currently I am using the following code. It does not work. Change the last line to use "summarise_" or to use "mean(as.name(cln))" does not fix it either. I can not use the dev version of dplyr because of a bug in devtools :(

for (cln in colnames(log))
{
  if(is.numeric(log[,cln])){
    gd <- log %>% 
      group_by(groups) %>%
      summarise(mean_value = mean(cln))
}}
gstar2002
  • 495
  • 9
  • 20

0 Answers0