Re: cbind is not generic as claimed, omits labels where S has them (PR#239)

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: cbind is not generic as claimed, omits labels where S has them (PR#239)
From: Ross Ihaka (ihaka@stat.auckland.ac.nz)
Date: Fri 06 Aug 1999 - 12:55:34 EST


Message-ID: <19990806145534.A3584@stat1.stat.auckland.ac.nz>

On Fri, Aug 06, 1999 at 12:08:05AM +0200, Peter Dalgaard BSA wrote:
> Ross Ihaka <ihaka@stat.auckland.ac.nz> writes:
>
> I played around with this earlier today. There's nothing special about
> dataframes, S does the same with any classed object. I.e.
>
> class(b)<-"my"
> cbind.my<-function(...)match.call()
>
> cbind(a,b)
>
> will dispatch cbind.my

I played some more. I think data frames are special somehow.

S> x <- factor(1:10)
S> y <- data.frame(1:10)
> class(x)
        [1] "factor"
S> class(y)
        [1] "data.frame"
S> class(cbind(x,y))
        [1] "data.frame"
S> class(cbind(y,x))
        [1] "data.frame"

They seem to overpower other class arguments too.

        Ross

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:07 EST