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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.