Re: [R] Calculations with aggregate data: mean +/- standard deviation

2014-03-20 Thread Rui Barradas
Hello, Try res[order(res[,1]), ] Hope this helps, Rui Barradas Em 20-03-2014 17:48, Luigi Marongiu escreveu: Dear Rui, Thnak you very much: this works exactly as I requested, but the merged vetor (res) order the variables by alphabetical order rather than by the factors I indicated during

[R] Calculations with aggregate data: mean +/- standard deviation

2014-03-19 Thread Luigi Marongiu
Dear all, I have obtained the averages (means) and standard deviations (SD) of different variable using the aggregate function, which I have found very useful for these kind of computation. However I would like to calculate the lower and upper ends of the data (that is mean - SD and mean + SD)

Re: [R] Calculations with aggregate data: mean +/- standard deviation

2014-03-19 Thread Rui Barradas
Hello, Maybe something like the following. res - merge(AVG, SD, by = stimulation) names(res)[2:3] - c(AVG, SD) res$lower - res$AVG - res$SD res$upper - res$AVG + res$SD res Hope this helps, Rui Barradas Em 19-03-2014 18:15, Luigi Marongiu escreveu: Dear all, I have obtained the averages