search for: diff_from_noon

Displaying 1 result from an estimated 1 matches for "diff_from_noon".

2011 Dec 15
1
Trouble converting hourly data into daily data
..., 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 the observation time (I converted time to a 0-1 scale so 0.5 represents noon): data$Diff_from_noon <- abs(0.5-data$Time) #Find the minimum value of "Diff_from_noon" for each Date: aggregated <- aggregate(Diff_from_noon ~ Date, data, FUN=min) The problem is that the "aggregated" data frame only has two columns: Date and Diff_from_noon. I can't figure out how to ge...