Re: [R] S4 slot containing either aov or NULL

2008-12-01 Thread Thomas Kaliwe
Thank you! Matthias Kohl schrieb: Dear Thomas, take a look at setOldClass ... ## register aov (an S3-class) as a formally defined class setOldClass(aov) ## list and some others are special cases; cf. class ? list ## now your code should work setClassUnion(aovOrNULL, c(aov, NULL))

[R] S4 slot containing either aov or NULL

2008-11-26 Thread Thomas Kaliwe
Dear listmembers, I would like to define a class with a slot that takes either an object of class aov or NULL. I have been reading S4 Classes in 15 pages more or less and Lecture: S4 classes and methods #First I tried with list and NULL setClass(listOrNULL) setIs(list, listOrNULL)

Re: [R] S4 slot containing either aov or NULL

2008-11-26 Thread Matthias Kohl
Dear Thomas, take a look at setOldClass ... ## register aov (an S3-class) as a formally defined class setOldClass(aov) ## list and some others are special cases; cf. class ? list ## now your code should work setClassUnion(aovOrNULL, c(aov, NULL)) setClass(c1, representation(value =