Hi Laura. Let's assume file 1 and 2 are vectors loaded in R named: vec1 and vec2,
here is a short code (with dummy numbers) for a solution: vec1 <- c(1,2,34,4,3,6,76) vec2 <- c(1,2,34,76,24,62,1,4234,435,4333,4422,304,776) which.vec2.where.in.vec1 <- vec2 %in% vec1 which.vec2.where.in.vec1.turned.into.yes.and.no<-ifelse(which.vec2.where.in.vec1 , "yes", "no") cbind(vec2, which.vec2.where.in.vec1.turned.into.yes.and.no) Cheers, Tal On Wed, Feb 25, 2009 at 6:17 PM, Laura Rodriguez Murillo < laura.lmuri...@gmail.com> wrote: > Hi dear list, > > If anybody could help me, it would be great! > > I have two files: > File 1 is a list (one column and around 100000 rows) > File 2 is a list with all the names from file one and a few more (one > column and more than 100000 rows) > > What I want is to add a column in file 2 that says which name appeared > in file 1 and which doesn't (yes and no would work as a code) > It's very important to keep the order of the names in file 2. > > Thank you! > > Laura > > ______________________________________________ > 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. > -- ---------------------------------------------- My contact information: Tal Galili Phone number: 972-50-3373767 FaceBook: Tal Galili My Blogs: www.talgalili.com www.biostatistics.co.il [[alternative HTML version deleted]] ______________________________________________ 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.