[Rd] Assignment of a derived instance to the parent container.
wolski at molgen.mpg.de
Mon Sep 20 19:20:46 CEST 2004
Is it intended to support assignment of a derived instance (S3) to a parent container (S4)?
setClass("myclass",representation(x="any",y="any")) # I define parent containers x,y
#I have an S3 object.
#instantiate a new object of class myclass
tt at x<-xx #not allowed as expected.
# I want to assign xx anyway. This should be possible if xx inherits class "any". This can be easily achieved by ?class.
class(xx) #now it is of class "any"
tt at x <- xx #but it still can not be assigned to the parent container.
#The same works for 'pure' S4 classes.
tt at x<-xx #works.
Is it intended to support S3 class inheritance within S4? It would be great because most of the objects in R are still S3.
More information about the R-devel