From Mike.Lawrence at dal.ca  Tue Sep 28 02:33:13 2010
From: Mike.Lawrence at dal.ca (Mike Lawrence)
Date: Mon, 27 Sep 2010 21:33:13 -0300
Subject: [Rd] Function works when custom defined but not when part of a
	package
Message-ID: <AANLkTinwXUM9GajqbMEVwChhyqLY7X90uc1NDbZ3zMp1@mail.gmail.com>

Hi folks,

I'm not sure if this is a bug or not so I thought I'd check here
first. I came across it while working on an update to my package where
I try to get AICtab slot from the summary of an lmer object (
summary(my_lmer)@AICtab ). The attached contains a minimal example,
where the code  below will work if you load the f() function by
sourcing the package's R code but will throw an error ("trying to get
slot "AICtab" from an object (class "table") that is not an S4
object") if you load the f() function by installing and loading the
package itself.

library(lme4)
#here is where you would either source('f.R') or library(dummy)

#fit an lmer model (from ?lmer examples)
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)

#run f()
f(fm1)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy_0.0-1.tar.gz
Type: application/x-gzip
Size: 470 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20100927/243c4318/attachment.gz>


[Rd] Function works when custom defined but not when part of a package
Mike Lawrence