[R] convert binary vector to time series of sum(x)/minute
andyjmac
andyjmac at gmail.com
Sat May 21 19:59:47 CEST 2011
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.
More information about the R-help
mailing list