Skip to content
Prev 59448 / 63430 Next

Unexpected behavior with inheritance and using S3 classes as slots in S4 class

Ezra,

I think it's just the fact the you specified the wrong class inheritance in setOldClass() - it has to match you S3 definition, so it should be:

setOldClass(c("b","a"))

In which case it works:
An object of class "n"
Slot "s1":
[1] "world"
attr(,"class")
[1] "b" "a"

Cheers,
Simon
Message-ID: <B931F4BF-A66B-46F4-8D6E-B3D64FB507F4@R-project.org>
In-Reply-To: <3NgorfmRHc0G3gBpmZfuMRSEcpfH6TwnVtcRctTA6Ze0ZYYOtgIzsYG0MekzBiWvSId53Cz1j2abdgJebaXo47kq7pK58pHQ-DrRIvJfhKc=@landtucker.com>