I should have known that  Gabor would reply within minutes with a nice
one-line solution ... :) 

On 28 September 2006 at 12:05, Gabor Grothendieck wrote:
| If Comparison and Candidates each have no duplicated rows (which
| is the situation in the example) then try this:
| 
| tail(!duplicated(rbind(Comparison, Candidates)), nrow(Candidates))

Excellent.  That will work.  Candidates has no dupes because expand.grid()
constructs it.  Comparison may have dupes, but we can ignore that.

By putting the 'larger set' against we which to compare second, we catch the
markers from duplicated(), and then subset via tail().  That's exactly what
needed.

Thanks, and chapeau for a very elegant one-liner,  Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison

______________________________________________
[email protected] 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