Re: [R] How to find S4 generics? (was: inames() function and lmer())

From: Spencer Graves <>
Date: Wed 19 Jul 2006 - 13:38:17 EST

          How can one obtain a simple list of the available generics for a class? For an S3 class, the 'methods' functions provide that. What about an S4 class? That's entirely opaque to me, if I somehow can't find the relevant information in other ways. For example, ?lmer-class lists many but not all of the methods available for objects of class 'lmer'. I think I once found a way to get that, but I'm not able to find documentation on it now.

          There is also the excellent vignette("MlmSoftRev") in the 'mlmRev' package. (For help with it, see, e.g., "".)

          Finally, the function 'str' will in most cases expose the structure of an object, thereby making it relatively easy to figure out how to get what is needed for many applications. That does not always work, however, because 'str' is a generic function, not a primitive. 'str' seems to expose everything one might possibly want to know about an 'lmer' object (apart from the theory behind it). This is not the case for an object of class 'logLik', because a function 'str.logLik' provides a succinct summary of a 'logLik' object in a non-standard format. The following will defeat 'str.logLik':

 > fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
 > lglk1 <- logLik(fm1)
 > str(lglk1)

Class 'logLik' : -871.8 (df=5) # I don't understand this.  > str(unclass(lglk1)) # This is in the standard 'str' format:   atomic [1:1] -872
	  Best Wishes,
	  Spencer Graves

A.R. Criswell wrote:
> Hello All,
> I would like to retrieve some of the results from the lmer(...)
> function in library lme4. If I run a model, say
> fm.1 <- lmer(y ~ 1 + (1 | x), data = dog)
> and try names(fm.1), I get NULL. Is there anyway to retrieve the information?
> Thanks
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! and provide commented, minimal, self-contained, reproducible code. Received on Wed Jul 19 13:42:51 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 19 Jul 2006 - 18:21:22 EST.

Mailing list information is available at Please read the posting guide before posting to the list.