> I have 2 vectors x & z > x has 10 variables in it > z has 75 variable in it > > I need to check all 75 variables in z and see if they are present in the > vector x.
In addition to the solution using %in% which has already been suggested, you may also want to play with something like this: # make up some data x = sample(1:8, 10, rep=T) z = sample(1:25, 75, rep=T) # find intersection between x and z intersect(x,z) cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Technische Universität München Wissenschaftszentrum Weihenstephan 85350 Freising, Germany and Institut für Bioinformatik und Systembiologie / MIPS Helmholtz Zentrum München - Deutsches Forschungszentrum für Gesundheit und Umwelt Ingolstädter Landstrasse 1 85764 Neuherberg, Germany http://mips.gsf.de/staff/pagel ______________________________________________ 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.