[R] avarage my data each hour

Rui Barradas ruipbarradas at sapo.pt
Tue Nov 6 20:32:58 CET 2012


Hello,

You should provide us with a data example. Since you haven't, look at 
the following code and see if you understand it.

# Make up some data
x <- Sys.time() + (1:1000)*15
y <- rnorm(1000)

brks <- cut(x, breaks = "hour")  # hour breaks
tapply(y, brks, mean)   # hourly means of 'y'


Hope this helps,

Rui Barradas
Em 06-11-2012 18:57, B. Bahar escreveu:
> Hello,
>
> I have much more than one milion tempreture is gained each 15 seconds. So
> each 15 seconds, I have one data.
> How could I calculate avarage datas in each hour in R?
>
> If you could help me.
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.




More information about the R-help mailing list