From wb at arb-phys.uni-dortmund.de  Fri Oct 24 14:52:28 2003
From: wb at arb-phys.uni-dortmund.de (wb@arb-phys.uni-dortmund.de)
Date: Fri Oct 24 14:51:22 2003
Subject: [Rd] NLME: gls parameter evaluation inconsistency (PR#4757)
Message-ID: <200310241252.h9OCqS0P011909@pubhealth.ku.dk>

Full_Name: W.B.Kloke
Version: 1.8.0
OS: FreeBSD-4.7
Submission from: (NULL) (195.253.22.63)


I found a parameter evaluation inconsistency in NLME package. I tried to use
gls() inside a function, and I wanted use gls() for different subsets of a data
frame:

prgls <- function(name){ gls( log10(Y)~(cond-1)+(cond-1):t
,pr,subset=subject==name)}

Applying this function with a string as parameter like prgls("VM") yields an
error
Error in eval(expr, envir, enclos) : Object "name" not found

The same definition with lm() instead of gls() works fine. Of course I want to
use the correlation features of gls(). It looks like a wrong environment at the
place of subset evaluation (the local variables and function paramaters are not
available). Probably lme(), ngls() and nlme() have the same inconsistency.


[Rd] NLME: gls parameter evaluation inconsistency (PR#4757)
wb@arb-phys.uni-dortmund.de