Dear all I am having two numerical vector the x and y. I would like to find the identical x,y pairs. How I can do that in R? I would like to thank you in advance B.R Alex [[alternative HTML version deleted]]
Perhaps which(x == y) or intersect(x,y) or x %in% y or many others. You really need to give an example of x and y and say what you mean by "identical pairs" to get any concrete suggestions. Michael On Thu, Mar 8, 2012 at 11:17 AM, Alaios <alaios at yahoo.com> wrote:> Dear all I am having two numerical vector the x and y. > > I would like to find the identical x,y pairs. How I can do that in R? > > I would like to thank you in advance > > > > B.R > Alex > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
Hi Alex, x <- sample.int(4,20,replace=TRUE) y <- sample.int(4,20,replace=TRUE) cbind(x,y)[x==y,] Thanks, Mitch -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Alaios Sent: Thursday, March 08, 2012 11:18 AM To: R help Subject: [R] Find identical pairs Dear all I am having two numerical vector the x and y. I would like to find the identical x,y pairs. How I can do that in R? I would like to thank you in advance B.R Alex [[alternative HTML version deleted]] ______________________________________________ R-help at 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.