[R] Simple - Finding vector in a vector

Berend Hasselman bhh at xs4all.nl
Mon Oct 8 20:40:00 CEST 2012


On 08-10-2012, at 18:00, Mike Spam wrote:

> Great, works perfekt now!
> Thanks for your fast help!

See this discussion for a variety of solutions: http://r.789695.n4.nabble.com/matching-a-sequence-in-a-vector-td4389523.html#a4393453
(or here https://stat.ethz.ch/pipermail/r-help/2012-February/303608.html )
There are some very fast ones.

If the vector in which you are searching contains NA's you will have to replace them by 0 or something.

Berend



More information about the R-help mailing list