4
I have a vector like this:
vectorx<-c(3,3,1,1,1,2,2,2,2,2,2,2,2,2)
And I want to check if the sequence 3,3,1,1,1,2 exists. It turns out that this sequence can be in any vector position, I just want to know if specifically this sequence like this exists, I want it to return TRUE or FALSE only. How do I do? I see many %in% but for a sequence that can occur in any position I haven’t seen yet. Personal thank you
A useful package for such problems is Traminer.
– Ailton Andrade de Oliveira