[Rd] setdiff bizarre (was: odd behavior out of setdiff)

G. Jay Kerns gkerns at ysu.edu
Sat May 30 16:21:20 CEST 2009

On Sat, May 30, 2009 at 8:50 AM, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> It seems to me that, abstractly, a dataframe is just as
> straightforwardly a sequence of tuples/observations as a vector is a
> sequence of scalars. R's convention is that a 1-vector represents a
> scalar, and similarly, a 1-dataframe can represent a tuple (though it
> can also be represented as a list). Of course, a dataframe can *also*
> be interpreted as a list of vectors.
> Just as a sequence of scalars can be interpreted as a set of scalars
> by the order- and repetition-ignoring homomophism, so can a sequence
> of tuples. It seems to me natural that set operations should follow
> that interpretation.
>          -s

After a good night's sleep, the documentation says clearly that
setdiff() operates on two vectors (of the same mode), so my message
would be an example of "garbage in, garbage out".

It would be nice if there were an error thrown, but surely there are
more mission critical problems than this one.

Thanks anyway.

More information about the R-devel mailing list