Hi, some time ago I asked R-help about aggregating data as a result I was able to put together some code which includes the line rain.ag <- aggregate(newdata, list(hod6=cut(mindata,"6 hours")), mean, na.rm=T) I also want to aggregate daily, and 30 minutely etc. My question is why is it that I get answers with list(.. "hours") but R cannot cope with list(.."6 hours") or any other multiple. I have tried overcoming this using nfrequency= but to no avail can someone help? Thanks Carla
Karla Meurk <ksm32 <at> student.canterbury.ac.nz> writes: : : Hi, some time ago I asked R-help about aggregating data as a result I : was able to put together some code which includes the line : : rain.ag <- aggregate(newdata, list(hod6=cut(mindata,"6 hours")), mean, : na.rm=T) : : I also want to aggregate daily, and 30 minutely etc. : : My question is why is it that I get answers with list(.. "hours") but R : cannot cope with list(.."6 hours") or any other multiple. I have tried : overcoming this using nfrequency= but to no avail : : can someone help? You need to provide a short reproducible example to illustrate your problem with an explanation of what you expect from the code. That means that someone can just copy the code from your posting and paste it into their session and see the exact same incorrect output or error that you got. If its not short you need to boil it down to something that is short before posting it.
On 6 Jan 2005 at 16:55, Karla Meurk wrote:> Hi, some time ago I asked R-help about aggregating data as a result I > was able to put together some code which includes the line > > rain.ag <- aggregate(newdata, list(hod6=cut(mindata,"6 hours")), mean, > na.rm=T) > > I also want to aggregate daily, and 30 minutely etc. > > My question is why is it that I get answers with list(.. "hours") but > R cannot cope with list(.."6 hours") or any other multiple. I have > tried overcoming this using nfrequency= but to no availHi Karla> aggregate(rnorm(100), list(weeks5 = cut(as.Date("2001/1/1") + 70*runif(100), "5 weeks")),mean)weeks5 x 1 2001-01-01 0.1272008 2 2001-02-05 0.1808671 This works as expected so you have some problems in your data and without giving more information what is mindata or what sort of answer you did get from above mentioned code nobody can help. Cheers Petr> > can someone help? > > Thanks > > Carla > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.htmlPetr Pikal petr.pikal at precheza.cz