Re: [R] Isolating a column within a loop

2010-02-01 Thread Steve Murray
Thanks! I've learnt something there! Steve _ We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now __ R-help@r-project.

Re: [R] Isolating a column within a loop

2010-02-01 Thread Henrique Dallazuanna
Try this: for (i in seq(nrow(index))) { assign(paste(model, "_mean_",index$year[i], index$month[i], sep=''), mean(get(paste(model, index$year[i], index$month[i], sep=''))[,3])) } On Mon, Feb 1, 2010 at 11:49 AM, Steve Murray wrote: > > Dear all, > > I am trying to calcul

[R] Isolating a column within a loop

2010-02-01 Thread Steve Murray
Dear all, I am trying to calculate the mean of one column for many data frames. The code I am using is as follows: > for (i in seq(nrow(index))) {         assign(paste(model, "_mean_",index$year[i], index$month[i], sep=''),   mean(get(paste(model, index$year[i], index$month[i], "[,3