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")
xc <- as.character(x)
(ans<-subSeq(xc))
ans$value
## Notice: Same results below
subSeq(xc, item="1")
subSeq(xc, item=1)
is_grouped(x)
is_grouped(sort(x))
is_grouped(xc)
is_grouped(sort(xc))
Run the code above in your browser using DataLab