Skip to content
Prev 181901 / 398513 Next

Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified

Jason,
On Fri, May 29, 2009 at 5:58 PM, Jason Rupert <jasonkrupert at yahoo.com> wrote:
Your previous post is here

[1]  http://tolstoy.newcastle.edu.au/R/e6/help/09/03/7781.html

and my earlier post is here:

[2]  https://stat.ethz.ch/pipermail/r-devel/2007-December/047706.html

(please note that the link in [1] referring to [2] is now broken).
As mentioned in [2], the notions of "set" and "element" are ambiguous
in the data frame case... what is an element...? a row, a column, or a
single entry?
Your question speaks to the ambiguity above.  For instance, your 2nd
example would be solved by a setdiff for data frames that operates
column-wise.  If that is all you want, then IIRC there are at least 3
independent solutions in [2] to the row-wise problem.  It should be
easy enough to tweak one of them to operate on columns instead.

For an efficient setdiff() for data frames that can decipher
on-the-fly which of row/column/entry is desired, I am going to have to
defer to the aforementioned Ninjas.  :-)
Ninjas.


Hope this helps,
Jay