From sfalcon at fhcrc.org  Tue Jan  3 19:39:13 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Tue, 03 Jan 2006 10:39:13 -0800
Subject: [Rd] S4 default initialization: unwanted NULL
In-Reply-To: <43BABE9B.4000901@r-project.org> (John Chambers's message of "Tue,
	03 Jan 2006 10:12:43 -0800")
References: <m2bqytfgv7.fsf@ziti.local> <43BAAF16.7030204@stamats.de>
	<43BABE9B.4000901@r-project.org>
Message-ID: <m2vex1dulq.fsf@ziti.local>

On  3 Jan 2006, jmc at r-project.org wrote:
> It's legal to have virtual classes as slots, but yes, the slot is
> NULL in the prototype for the new class, unless the user specifies a
> value.  In your case, providing a non-null prototype for the
> data.frame slot might be the desired solution.

Yes, that's a workaround.  

> There is no S4 "initialization" for S3 classes; in fact, it's
> generally an error to use new() on them (or on other virtual
> classes).

The "basic vector classes" (see man page for new) can be created
with new().  From my perspective it would be more consistent if
data.frame and factor behaved similarly.  

I admit that I don't understand why data.frame and factor are virtual
classes and don't know what would be involved to have new() work for
data.frame and factor.

+ seth



[Rd] S4 default initialization: unwanted NULL
Seth Falcon