Skip to content
Prev 247372 / 398503 Next

Selecting the first occurrence of a value after an occurrence of a different value

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