From gregor.gorjanc at bfro.uni-lj.si  Sat Nov  4 13:09:52 2006
From: gregor.gorjanc at bfro.uni-lj.si (Gregor Gorjanc)
Date: Sat, 04 Nov 2006 13:09:52 +0100
Subject: [Rd] How to put my S4 class into data.frame
In-Reply-To: <17740.24717.488162.230545@stat.math.ethz.ch>
References: <454BDFF5.7080901@bfro.uni-lj.si>	<454BE4C5.70504@iq.harvard.edu>	<454BE839.3000109@bfro.uni-lj.si>
	<17740.24717.488162.230545@stat.math.ethz.ch>
Message-ID: <454C8310.80308@bfro.uni-lj.si>

Hi,

Martin Maechler wrote:
>>>>>> "Gregor" == Gregor Gorjanc <gregor.gorjanc at bfro.uni-lj.si>
>>>>>>     on Sat, 04 Nov 2006 02:09:13 +0100 writes:
> 
>     Gregor> Ferdinand Alimadhi wrote:
> 
>       >> tmp$comp <- x at ratios ?!
> 
>     Gregor> I "lose" class here and that is not what I
>     Gregor> want. Perhaps I should stick with list instead of
>     Gregor> data.frame.
> 
> Yes, I probably would, at least for the time being.

OK. Why do you say "at least for the time being"? Are there any plans to
generalize putting S4 classes that are not atomic into data.frame?

> OTOH, it's interesting that some methods to "stick some S4
> objects into a data frame do work fine , at least for the
> following case (R-script below) -- and I wonder if we (R developers)
> shouldn't think about more explicitly supporting this,
> e.g., by stating something like
> 
>  >>  If an S4 object simply *contains* an atomic class that can be
>  >>  used as data.frame column, then that S4 object can also be used
>  >>  as data.frame column
> 

Gregor



[Rd] How to put my S4 class into data.frame
Gregor Gorjanc