Julio, Nobody mentioned the _set_ operations union(), intersect(), setdiff(), which are described under 'help(union)' (and the other names, of course)
R> X <- c(10:13, 17,18) R> Y <- c(11,12,17,18) R> intersect(X, Y) # gives the actual values [1] 11 12 17 18 R> X %in% intersect(X, Y) # use %in% to map to bool as desired [1] FALSE TRUE TRUE FALSE TRUE TRUE R> Oh, and no need to reply on-list to thousands of list subscribers if you found this helpful. These one-line 'thanks' message are not that universally useful, even though they are very polite :) Dirk -- R/Finance 2012 Conference on May 11 and 12, 2012 at UIC in Chicago, IL See agenda, registration details and more at http://www.RinFinance.com ______________________________________________ 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.