From gregor.gorjanc at bfro.uni-lj.si  Sat Nov  4 17:37:33 2006
From: gregor.gorjanc at bfro.uni-lj.si (Gregor Gorjanc)
Date: Sat, 04 Nov 2006 17:37:33 +0100
Subject: [Rd] How to put my S4 class into data.frame
In-Reply-To: <454CA213.6000309@r-project.org>
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>
	<454C8310.80308@bfro.uni-lj.si> <454CA213.6000309@r-project.org>
Message-ID: <454CC1CD.9020700@bfro.uni-lj.si>

John Chambers wrote:
> Designing a "better data frame" is something many people have likely
> thought about; I certainly have.
> 
> But data frames are so widely used and so central to models and other
> software that a major change needs to be done by the user community, or
> at least with maximum feedback, IMO.
> 
> Also, my prior feeling would be that it's better to think of an S4 class
> to play the role of data.frame, rather than tinkering with the S3 class
> to allow S4 columns.  Having formal classes (particularly using class
> unions to abstract notions about variables in the data frame)  lets one
> create a more precise and reliable definition.
> 
> It's true, though, that one then has to work out the details of
> interfacing the S4 data frame class to current software that works with
> the S3 data.frame class.  AFAICS that is not too hard, but of course the
> details would be important.
> 
> I've played around with some of these ideas, more as educational aids in
> discussing classes and methods than as a serious proposal.  Last time I
> looked, the writeup was not at a level I would feel happy circulating
> :-}  But perhaps a group of interested people could exchange some ideas.

As far as I see this (at the risk of uterly simplifying the issue) new
data.frame (perhaps dataFrame) could just be a list? of classes that
have the same length i.e. length() should have the same value.

Gregor



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