r - aggregate over multiple columns -


hey have data looks this:

expnum  compound peak tau ss 1              100  30  50 2              145  23  45 3        b       78   45  56 4        b       45   43  23 5        c       344  23  56 

id fund mean based on compound name have

norm_table$norm_peak = (aggregate(data[[3]],by=list(compound),fun=normalization)) 

this fine , have coding repeating 3 times changing data[[x]] number. lapply work here? or loop?

a dplyr solution:

library(dplyr) data %>%   group_by(compound) %>%   summarize_each(funs(mean), -expnum) 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -