[R] Grouping of data frames to calculate means

Steve Murray smurray444 at hotmail.com
Mon Apr 6 11:55:28 CEST 2009


Dear R Users,

I have 120 data frames of the format table_198601, table_198602... table_198612, table_198701, table_198702... table_198712 through to table_199512 (ie. the first 4 digits are years which vary from 1986 to 1995, and the final two digits are months which vary from 01 to 12 for each year).

I simply hope to find the means of column 3 of each of the 120 tables without having to type out mean(table_198601[3]) etc etc each time. How would I go about doing this? And how would I go about finding the mean of all the January months (01) from say 1986 to 1990?

Finally, I hope to be able to plot (as a scatter graph) the values of column 1 against the mean of those from column 3 for all the months in the period 1989 to 1990 and then 1991 to 1995.

Any help offered would be very much appreciated.

Thanks,

Steve

_________________________________________________________________
[[elided Hotmail spam]]




More information about the R-help mailing list