How to create a column with the sum ggplot

I'm not sure what you mean by 'test' -- could you describe the specific calculations you were hoping to make?

I'm so sorry... I was very busy but I found a solution with an extra line sum(x[[col]])

data_summary_session2 <- function(data = dfdata_session2, varname =, groupnames = c(Odeur,{
  summary_func <- function(x, col){
    c(mean = mean(x[[col]], na.rm=TRUE),
      sd = sd(x[[col]], na.rm=TRUE),
      sum = sum(x[[col]], na.rm = TRUE))
  data_sum<-ddply(data, groupnames, .fun=summary_func,
  data_sum <- rename(data_sum, c("mean" = varname))

Thanks a lot for your help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.