Re: [Rd] S4 default initialization: unwanted NULL

2006-01-03 Thread John Chambers
Seth Falcon wrote: >On 3 Jan 2006, [EMAIL PROTECTED] 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 th

Re: [Rd] S4 default initialization: unwanted NULL

2006-01-03 Thread Seth Falcon
On 3 Jan 2006, [EMAIL PROTECTED] 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, t

Re: [Rd] S4 default initialization: unwanted NULL

2006-01-03 Thread Seth Falcon
On 3 Jan 2006, [EMAIL PROTECTED] wrote: > you might need a call to "setOldClass"; see Section "Register or > Convert?" of the corresponding help page. That doesn't seem to make a difference. Note that other non-S4 slots like "matrix" initialize in an appropriate (non-NULL) fashion. ___

Re: [Rd] S4 default initialization: unwanted NULL

2006-01-03 Thread John Chambers
S3 classes are treated as virtual classes, with or without a call to setOldClass()--the purpose of setOldClass() is to make method dispatch with S3 inheritance work. 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 specif

Re: [Rd] S4 default initialization: unwanted NULL

2006-01-03 Thread Matthias Kohl
you might need a call to "setOldClass"; see Section "Register or Convert?" of the corresponding help page. Matthias Seth Falcon schrieb: >The default initialization for slots of class "factor" and >"data.frame" gives NULL. This seems odd, since those slots can't ever >be set to NULL by the use

[Rd] S4 default initialization: unwanted NULL

2006-01-03 Thread Seth Falcon
The default initialization for slots of class "factor" and "data.frame" gives NULL. This seems odd, since those slots can't ever be set to NULL by the user. I would expect zero-length instances of factor and data.frame. Here is an example: setClass("FOO", representation(a="factor", b="data.fram