s it what you want?
Petr
From: zuzana zajkova [mailto:zuzu...@gmail.com]
Sent: Friday, May 03, 2013 7:10 PM
To: PIKAL Petr; jholt...@gmail.com
Cc: r-help@r-project.org
Subject: Re: [R] Counting number of consecutive occurrences per rows
Hi,
I'm sorry that it takes me so much time to respond,
limits, include.lowest=T)))
> res <- rep(rrr$lengths, rrr$lengths)
> res
> }
>
> you can use split/lapply approach
>
> test$res2<-unlist(lapply(split(test$act, factor(test$day, levels=c(1,0))),
> fff))
>
> Beware of correct ordering of days in output. Without
[0,1] 4
2 14655 (1,199] 1
3 14655 (199,200] 2
Regards
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of zuzana zajkova
> Sent: Monday, April 29, 2013 12:45 PM
> To: r-help@r-project.org
> Subject
try this:
> test <- structure(list(jul = structure(c(14655, 14655, 14655, 14655,
+ 14655, 14655, 14655, 14655, 14655, 14655, 14655, 14655, 14655,
+ 14655, 14655, 14655), origin = structure(0, class = "Date")),
+ time = structure(c(1266258354, 1266258954, 1266259554, 1266260154,
+ 126626075
Forgot the last part of the question:
> test <- structure(list(jul = structure(c(14655, 14655, 14655, 14655,
+ 14655, 14655, 14655, 14655, 14655, 14655, 14655, 14655, 14655,
+ 14655, 14655, 14655), origin = structure(0, class = "Date")),
+ time = structure(c(1266258354, 1266258954, 1266259554,
Hi,
I would appreciate if somebody could help me with following calculation.
I have a dataframe, by 10 minutes time, for mostly one year data. This is
small example:
> dput(test)
structure(list(jul = structure(c(14655, 14655, 14655, 14655,
14655, 14655, 14655, 14655, 14655, 14655, 14655, 14655, 1
6 matches
Mail list logo