Convert to strings and use grep functions. using c for variable is a bad idea.
a <- paste(a, collapse="") b <- paste(b, collapse="") d <- paste(d, collapse="") grepl(b,a) grepl(d,a) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Sep 21, 2010, at 6:31 AM, Lorenzo Isella wrote:
a<-c(1,4,3,0,4,5,6,9,3,4) b<-c(0,4,5) c<-c(5,4,0)
______________________________________________ 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.