Dear Sherri Heck,

Try something like:


my.df<-read.table(stdin(), head=T, sep=",")
doy,yr,mon,day,hr,hgt1,hgt2,hgt3,co21,co22,co23,sig1,sig2,sig3,dif,flag
244.02083,2005,09,01,00,2.6,9.5,17.8,375.665,373.737,373.227,3.698,1.107,0.963,-0.509,PRE
244.0625,2005,09,01,01,2.6,9.5,17.8,393.66,384.773,379.466,15.336,11.033,5.76,-5.307,PRE
244.10417,2005,09,01,02,2.6,9.5,17.8,411.162,397.866,387.755,6.835,5.61,6.728,-10.112,PRE
244.14583,2005,09,01,03,2.6,9.5,17.8,417.78,395.579,392.838,13.897,4.631,4.998,-2.741,PRE
244.1875,2005,09,01,04,2.6,9.5,17.8,420.844,408.747,401.923,5.673,7.154,4.312,-6.823,PRE
244.22917,2005,09,01,05,2.6,9.5,17.8,414.714,404.652,401.141,3.72,3.296,4.028,-3.511,PRE
244.27083,2005,09,01,06,2.6,9.5,17.8,423.77,405.623,401.815,5.23,2.808,2.653,-3.808,PRE
244.3125,2005,09,01,07,2.6,9.5,17.8,415.703,406.324,399.115,4.189,3.441,3.648,-7.209,PRE
244.35417,2005,09,01,08,2.6,9.5,17.8,416.343,403.47,398.71,4.344,2.145,1.482,-4.76,PRE
244.39583,2005,09,01,09,2.6,9.5,17.8,413.512,401.195,398.106,3.941,2.663,1.905,-3.089,PRE
244.4375,2005,09,01,10,2.6,9.5,17.8,419.308,406.377,401.889,3.443,2.888,1.471,-4.488,PRE
244.47917,2005,09,01,11,2.6,9.5,17.8,415.864,406.004,400.702,2.082,1.858,2.507,-5.302,PRE
244.52083,2005,09,01,12,2.6,9.5,17.8,413.062,405.385,400.509,4.142,2.041,2.52,-4.877,PRE
244.5625,2005,09,01,13,2.6,9.5,17.8,407.566,396.001,392.831,7.445,5.028,3.691,-3.17,PRE
244.60417,2005,09,01,14,2.6,9.5,17.8,395.374,385.151,384.275,8.889,2.422,2.115,-0.876,PRE
244.64583,2005,09,01,15,2.6,9.5,17.8,383.308,382.984,383.43,1.546,1.168,1.529,0.446,PRE
244.6875,2005,09,01,16,2.6,9.5,17.8,379.112,379.168,379.209,1.475,1.478,1.365,0.041,PRE
244.72917,2005,09,01,17,2.6,9.5,17.8,372.948,373.424,373.737,1.52,1.721,1.827,0.313,PRE
244.77083,2005,09,01,18,2.6,9.5,17.8,373.435,373.479,373.498,0.431,0.29,0.187,0.019,PRE
244.8125,2005,09,01,19,2.6,9.5,17.8,374.082,374.11,374.104,0.264,0.227,0.242,-0.006,PRE

my.df

my.df.avg<-aggregate(my.df[c("co23", "co21")], list(c(my.df$hr)), mean)

my.df.avg



If you want to compute average for other variables, just include on the list
of

my.df[c("co23", "co21", "...", "..")

Case you want to compute other statistics like min, max, sd, var (or other
statistics that you build functions for), try to use doBy package.



I hope this helps,



Cheers,



miltinho astronauta

brazil

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to