I have been trying many ways to match 2 separate fields in a matrix. Here is a simplified version of the matrix:
site1 depth1 year1 site2 depth2 year2 10 30 1860 NA NA NA NA NA NA 50 30 1860 Basically I am trying to identify the sites which have a common year and depth from 2 datasets. What I would like to do is match all of the year1 field to year2 field and the depth1 field and to depth2 field. Then I would like to output site1, site2, depth, and year. I have been trying if loops, which(), isTRUE(), etc. but I have not come up with anything that works. Any help would be greatly appreciated. Jeremy -- View this message in context: http://r.789695.n4.nabble.com/matching-multiple-fields-from-a-matrix-tp4664309.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.