Displaying 1 result from an estimated 1 matches for "myconstructor".
Did you mean:
mconstructor
2012 Dec 12
1
Lost in S4 and S3 classes
...ass("nls.lm")
setClass (
Class="TestClass",
representation=representation(
lmOutput = "nls.lm",
anumeric = "numeric"
)
)
Now, if I want to call this class in a "constructor function" I can do something like this (correct?):
myConstructor <- function()
{
return(new("TestClass"))
}
pippo <- myConstructor()
> pippo
An object of class "TestClass"
Slot "lmOutput":
<S4 Type Object>
attr(,".S3Class")
[1] "nls.lm"
Slot "anumeric":
numeric(0)
And the object &q...