From wolski at molgen.mpg.de  Thu Sep 30 15:21:01 2004
From: wolski at molgen.mpg.de (Witold Eryk Wolski)
Date: Thu Sep 30 15:21:10 2004
Subject: [Rd] Problem with _new_ if class "lm" in object  representatio n.
In-Reply-To: <6.0.1.1.2.20040930145247.01faaec0@stat4ux.stat.ucl.ac.be>
References: <18D602BD42B7E24EB810D6454A58DB900A29BB79@ibfftce505.de.ad.drkw.net>
	<415BFD9F.2080101@molgen.mpg.de>
	<6.0.1.1.2.20040930145247.01faaec0@stat4ux.stat.ucl.ac.be>
Message-ID: <415C083D.8000106@molgen.mpg.de>

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


[Rd] Problem with _new_ if class "lm" in object representatio n.
Witold Eryk Wolski