I used aggregate function in r to calculate the mean and sd for different group at different time points
aggregate(.~ Group + Time, data = x, FUN = function(x) c(m = mean(x), n = sd(x)))
I have a question, that this also gives me the mean and sd for the ID of the data, so my result looks like this:
# Time Group ID.m ID.n result.m result.n
# 1 0 x 20.5 10.0 6.5 1.15
# 2 1 x 20.5 10.0 8.0 2.13
# 3 0 y 20.5 10.0 7.0 2.66
...
How can I remove the mean and sd for ID, and also I would like to make a plot of mean and mean+-sd for each group at different times(time as x-axis), how can I do this??