[Rd] prototype in setClass.

From: Wolski <wolski_at_molgen.mpg.de>
Date: Wed 15 Sep 2004 - 06:34:18 EST


To specify a prototype in the setClass declaration is a great feature. But prototype seems no to work for slots of the "super" class. eg. The following code is declaring first the super class "List". This class has a slot "content". The class "AtomList" inherits from it and I would like to set content="Atom" by prototype(content="Atom"). But after new("AtomList") is called the slot content is empty as you can see running the code below.



                         ,content="character"                           ##### would like to set this when declaring the inheriting class.

) setClass("AtomList"
,prototype(content="Atom") ## would like to specify this


An object of class "AtomList"
Slot "uniq":
[1] FALSE Slot "content":

character(0)                                                            #######<-still not specified even if provided in prototype.

Slot "names":


R : Copyright 2004, The R Foundation for Statistical Computing Version 2.0.0 alpha (2004-09-14), ISBN 3-900051-07-0 or
R1.9.1 patched.


R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Sep 15 06:40:10 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:00:18 EST