[Rd] Error in "getClass" when calling the function "show"

Laurent Gautier lgautier at gmail.com
Tue Jun 10 06:23:34 CEST 2008


Dear List,

Calling "show" on an object of class "summary.lm" gives:
Error in getClass(class(object)) : "summary.lm" is not a defined class

Is this a miss on my end ?


> x <- seq(1, 10)
> show(x)
 [1]  1  2  3  4  5  6  7  8  9 10
> y <- runif(10)
> fit <- lm(y ~ x)
> show(fit)

Call:
lm(formula = y ~ x)

Coefficients:
(Intercept)            x
    1.04938     -0.08869

> show(summary(fit))
Error in getClass(class(object)) : "summary.lm" is not a defined class
> class(summary(fit))
[1] "summary.lm"
> class((fit))
[1] "lm"
> getClass("lm")
Virtual Class

No Slots, prototype of class "S4"

Extends: "oldClass"

Known Subclasses:
Class "mlm", directly
Class "aov", directly
Class "glm", directly
Class "maov", by class "mlm", distance 2
Class "glm.null", by class "glm", distance 2
> getClass("summary.lm")
Error in getClass("summary.lm") : "summary.lm" is not a defined class
>
> sessionInfo()
R version 2.7.0 Patched (2008-06-07 r45877)
i686-pc-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


Laurent



More information about the R-devel mailing list