Re: [R] Sum per hour

From: Anup Nandialath <anup_nandialath_at_yahoo.com>
Date: Thu, 24 May 2007 12:29:07 -0700 (PDT)


hi jessica,

this should possibly do it...

year <- as.data.frame(c("2000-10-03","2000-10-03","2000-10-03","2000-10-03","2000-10-03","2000-10-03" ,"2000-10-03","2000-10-04","2000-10-04","2000-10-04")) colnames(year) <- c("year")
time <- as.data.frame(c("14:00:00","14:10:00","14:20:00","15:30:00","16:40:00","16:50:00", "17:00:00","17:10:00","17:20:00","18:30:00")) colnames(time) <- c("time")

precipitation<-c(0,0.1,0,0,0,0,0.2,0.3,0.5,6)

DATA<-(cbind(year, time ,precipitation))

tapply(precipitation, year, sum)
tapply(precipitation, time, sum)        


        [[alternative HTML version deleted]]



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.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 24 May 2007 - 19:39:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 May 2007 - 20:33:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.