[R] Group by
wwwhsd at gmail.com
Thu Mar 11 13:16:10 CET 2010
DF <- read.csv(textConnection("V1,V2,V3
10:05:33,8.2,998"), header = TRUE)
tDates <- strptime(DF$V1, "%H:%M:%S")
tDates[] <- floor(strptime(DF$V1, "%H:%M:%S")[] / 5) * 5
FUN = sum)
On Thu, Mar 11, 2010 at 6:48 AM, ManInMoon <xmoon2000 at googlemail.com> wrote:
> I have a matrix with a POSIXct as a numeric in the first column.
> I would like to create a new matrix that is "grouped by" my chosed time
> i.e. So I would like to group by hour or day or 5 days, and have all my
> columns be summed or averaged or counted..
> I want to convert this into say 5 minutes "bars" and sum columns
> How can I do this?
> View this message in context: http://n4.nabble.com/Group-by-tp1588694p1588694.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
25° 25' 40" S 49° 16' 22" O
More information about the R-help