[R] Selecting the first occurrence of a value after an occurrence of a different value

surreyj surreyjackson at gmail.com
Sat Jan 15 03:01:54 CET 2011


Thanks so much for your help everyone, got it sorted now :)

this is what I used in the end:

timeofonlyfirstresponseafterrft<-testdata$Time[test<-which(!diff(as.numeric(factor(Stat,
levels = c("MagDwn", "Resp")))))]
timeofonlyfirstresponseafterrft1<-as.POSIXct(timeofonlyfirstresponseafterrft,
origin="timeofstart[1]", format="%Y,%m,%d, %H, %M, %OS")

Cheers

Surrey
-- 
View this message in context: http://r.789695.n4.nabble.com/Selecting-the-first-occurrence-of-a-value-after-an-occurrence-of-a-different-value-tp3217340p3218653.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list