On Mon, Oct 7, 2013 at 2:01 PM, Stuart Luppescu <lupp@uchicago.edu> wrote:

> Hello, I've been using code like this for a while with no problems:
>
> total.var7 <- sum(as.numeric(summary(lme7)@REmat[,3]))
>
> but recently when I try this I get this message:
>
> Error: trying to get slot "REmat" from an object (class
> "summary.merMod") that is not an S4 object
>
> Can someone tell me why this doesn't work anymore?
>

Because the internal representation changed.  When you depend on a
particular representation and want to pick off certain slots or components
and certain columns, like this, you are running the risk that things will
change.

Use the extractors instead.  I imagine that you are looking for something
like

sum(as.numeric(VarCorr(lme7)))

although this will only work in cases with scalar random effects.


>
> I have figured out a way to get around this, but it's semi-clumsy; I
> much prefer the original.
>
> Thanks.
> --
> Stuart Luppescu -=-=- slu <AT> ccsr <DOT> uchicago <DOT> edu
> CCSR at U of C ,.;-*^*-;.,  ccsr.uchicago.edu
>      (^_^)/    $B:MJ8$HCRF`H~$NIc(B
> [Crash programs] fail because they are based on the theory that,
> with nine women pregnant, you can get a baby a month.
>                 -- Wernher von Braun
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>

	[[alternative HTML version deleted]]

