Dear list:

I have two dataframes, say dat1 and dat2. Each has several variables but
3 of each are common in both, (say v1, v2 and v3). v1 and v2 are
factores while v3 is numeric. Now, I need a subset to extract the rows
in which v1, v2 and v3 are the same in both dataframes.
I tried:

subset(dat1, dat1$v1 %in% dat2$v1 & dat1$v2 %in% dat2$v2 & dat1$v3 %in%
dat2$v3)

I dont know why, but this is not working as I was expecting. Any
suggestion to improve my code?

Thanks in advance

Justin
-- 
  
  [EMAIL PROTECTED]

--

______________________________________________
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.

Reply via email to