Re: [R] Trouble converting hourly data into daily data

2011-12-23 Thread Sean Baumgarten
Weather, FUN = which.min) n.obs <- cumsum(rle(as.double(Weather$Date))$lengths) n.obs <- c(0, n.obs[1:(length(n.obs) - 1)]) noon.ind <- agg$diff.time + n.obs subset <- Weather[noon.ind,] Cheers, Sean On Mon, Dec 19, 2011 at 6:03 AM, Jean V Adams wrote: > > Sean Baumgarten wr

[R] Trouble converting hourly data into daily data

2011-12-14 Thread Sean Baumgarten
Hello, I have a data frame with hourly or sub-hourly weather records that span several years, and from that data frame I'm trying to select only the records taken closest to noon for each day. Here's what I've done so far: #Add a column to the data frame showing the difference between noon and th