| subSeq {doBy} | R Documentation |
Find sub-sequences of identical elements in a vector.
subSeq(x, item = NULL)
x |
An atomic vector. |
item |
Optionally a specific value to look for in 'x'. |
A dataframe.
Søren Højsgaard, sorenh@math.aau.dk
x <- c(1, 1, 1, 0, 0, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 3) (ans <- subSeq(x)) ans$value # Notice: Same results below subSeq(x, item=1) subSeq(x, item="1") x <- as.character(c(1, 1, 1, 0, 0, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 3)) (ans<-subSeq(x)) ans$value # Notice: Same results below subSeq(x, item="1") subSeq(x, item=1)