[R] convert binary vector to time series of sum(x)/minute

From: andyjmac <andyjmac_at_gmail.com>
Date: Sat, 21 May 2011 10:59:47 -0700 (PDT)


Dear members,

I apologize for the relatively simple request, but I couldn't find exactly what I was looking for. I have a binary vector [1,0] representing presence/absence at 1 second intervals over length(N). I would like to convert this to a new time series vector with N/60 elements that represent the sum of x/minute.

In other words, I'd like to get from:

e.g. x = [1,0,1,1,0,1,1,1,0,0,0,1,0,1, ... ] *N=6,000

to

e.g. x = [35, 40, 10, 29, ... ] *where each element has min=0 and max=60 over length N=100

Thanks so much,

mac
Kyoto University, Japan

--
View this message in context: http://r.789695.n4.nabble.com/convert-binary-vector-to-time-series-of-sum-x-minute-tp3540942p3540942.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.
Received on Sat 21 May 2011 - 18:41:09 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Sat 21 May 2011 - 19:00:08 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.

list of date sections of archive