Re: [Rd] Problem with _new_ if class "lm" in object representatio n.

From: Witold Eryk Wolski <wolski_at_molgen.mpg.de>
Date: Thu 30 Sep 2004 - 23:21:01 EST

Hi,

Yes indeed. Thanks.

Yours

Eric Lecoutre wrote:

>
> Hi,
>
> For your lm problem, you could begin to create a virtual class that
> accepts either NULL or a lm object:
>
> > setClassUnion("mylm", c("NULL","lm"))
> > setClass("foo", representation(x="numeric", y="mylm"))
> > new("foo",x=1,y=NULL)
>
> Then, you have to check the content of slot y in any function that
> will manipulate objects of class "foo":
>
>
> setMethod("show","foo",function(object)
> {
> cat("\n object of class foo")
> if (!is.null(object@y)) cat(" does have a lm object in slot y!")
> })
>
>
> Eric
>

-- 
Dipl. bio-chem. Witold Eryk Wolski         
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin           _
tel: 0049-30-83875219                   'v'
http://www.molgen.mpg.de/~wolski       /   \
mail: witek96@users.sourceforge.net  ---W-W----
      wolski@molgen.mpg.de

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu Sep 30 23:28:21 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:18 EST