From Mike.Lawrence at dal.ca  Tue Sep 28 17:41:51 2010
From: Mike.Lawrence at dal.ca (Mike Lawrence)
Date: Tue, 28 Sep 2010 12:41:51 -0300
Subject: [Rd] Function works when custom defined but not when part of a
	package
In-Reply-To: <4CA1B9FB.5010004@statistik.tu-dortmund.de>
References: <AANLkTinwXUM9GajqbMEVwChhyqLY7X90uc1NDbZ3zMp1@mail.gmail.com>
	<4CA1B9FB.5010004@statistik.tu-dortmund.de>
Message-ID: <AANLkTikaU1YxwuWdLS5ecwiWH+uNsL3+yFuc7Yit+Lnh@mail.gmail.com>

Ah, "forgot" is a bit too generous. Seems I failed to get that far in
the Extensions manual because I never dealt with S4 classes until now.
Thanks for the pointer.

Mike

--
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University

Looking to arrange a meeting? Check my public calendar:
http://tr.im/mikes_public_calendar

~ Certainty is folly... I think. ~



2010/9/28 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
> I guess you forgot to import the relevant S4 functionality into your
> namespace.
>
> Best,
> Uwe
>
>
>
> On 28.09.2010 02:33, Mike Lawrence wrote:
>>
>> 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)
>>
>>
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



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