On Sep 27, 2012, at 2:00 PM, Atte Tenkanen wrote: > Hi, > > There are certainly several ways to test, whether a longer vector includes a > subvector. > For instance, c(1,4,6) is included in c(2,1,1,4,6,3). How to test this and > which would be the fastest way to do it? >
> all( c(1,4,6) %in% c(2,1,1,4,6,3) ) [1] TRUE -- David Winsemius, MD Alameda, CA, USA ______________________________________________ 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.