From wolski at molgen.mpg.de  Wed Sep 29 19:20:31 2004
From: wolski at molgen.mpg.de (Wolski)
Date: Wed Sep 29 19:20:35 2004
Subject: [Rd] Problem with _new_  if  class "lm" in object representation.
Message-ID: <200409291920310735.30925C98@mail.math.fu-berlin.de>

Hi!
Consider this code.


setClass("Ctest"
	,representation(
		test="character"
		,bla="character"
		,mod="lm" 
		)
	)
	
new("Ctest",test="bla")                     #This produces an error.

#Error in validObject(.Object) : Invalid "Ctest" object: Invalid object for slot "mod" in class "Ctest": got class "NULL", should be or extend class "lm"



setClass("Ctest"
	,representation(
		test="character"
		,bla="character"
		,mod="character"                # its the only with the class definition above.
	)
	)
new("Ctest",test="bla")                         #this works as I would expect.

#An object of class "Ctest"
#Slot "test":
#[1] "bla"
#
#Slot "bla":
#character(0)
#
#Slot "mod":
#character(0)


Thought that this is due to that the class lm has no lm(0) object. Hence i tried

setClass("brum",representation(brum="brum"))
setClass("Ctest"
	,representation(
		test="character"
		,bla="character"
		,mod="brum"                # its the only with the class definition above.
	)
	)

new("Ctest",test="best")  #but this works to.


[Rd] Problem with _new_ if class "lm" in object representation.
Wolski