Re: [R] setdiff datframes

2012-06-25 Thread arun
Hi, Try this: example1<-data.frame(V1=c("rs4685","rs4685","rs788018","rs788023"),V2=c("2:198257795","2:198257795","2:198265526","2:198283305")) example2<-data.frame(V1=c("rs4685","rs4675","rs788018","rs788023"),V2=c("2:198257795","2:198258795","2:198265526","2:198283305")) subset(example2,!(V1 %in

Re: [R] setdiff datframes

2012-06-25 Thread nac
thanks it works brilliantly wrote: > Hello, > > It is recomended to post data using dput(). Something like > > dput(head(DF, 20)) # or 30 > > Then, paste the output of this command in a post. > > Untested, but I think it should work: > > > # Create a logical index into 'example2' > ix <

Re: [R] setdiff datframes

2012-06-25 Thread Rui Barradas
Hello, It is recomended to post data using dput(). Something like dput(head(DF, 20)) # or 30 Then, paste the output of this command in a post. Untested, but I think it should work: # Create a logical index into 'example2' ix <- example2$V1 %in% setdiff(example2$V1,example1$V1) example2[ix,