From kjbeath at kagi.com  Tue Jan 15 23:42:38 2008
From: kjbeath at kagi.com (Ken Beath)
Date: Wed, 16 Jan 2008 09:42:38 +1100
Subject: [Rd] bug in mmlcr ? (PR#10576)
In-Reply-To: <20080115084026.CAACE2834632@mail.pubhealth.ku.dk>
References: <20080115084026.CAACE2834632@mail.pubhealth.ku.dk>
Message-ID: <FDD13B8A-19A9-4A11-8280-34366A2F07C8@kagi.com>

On 15/01/2008, at 7:40 PM, cgenolin at u-paris10.fr wrote:

> Hi the list.
>
> Is there a bug in mmlcr package ?
> The following code does not compile:
>
> mmlcrTest <- function(dataW){
>  dataL <-
> reshape
> (dataW
> ,idvar
> =
> "id
> ",timevar
> ="T",varying=list("T0","T1","T2"),direction="long",v.names="score")
>
>  resultR <- mmlcr(outer= ~ 1 | id,
>                   components = list(list(formula = score~1+T,class=
> "normlong")),                         n.groups=3,
>                   data=dataL,
>                   max.iter=500
>                   )
>  plot(resultR)
> }
> mmlcrTest(dataW)
>
> The error is (translate from french):
> "Error in inherits(x, "data.frame") : objet "dataL" not find"
>
> It seems that mmlcr does not look for the data at the right place  
> since
> it did find dataL if we set it a a global variable but it does not  
> find
> it if we define it in a function.
>

This should be directed to the package maintainer Steve Buyske, who I  
have included in the reply.

Ken



[Rd] bug in mmlcr ? (PR#10576)
Ken Beath