Jun Shen
2010-Jul-11 21:21 UTC
[R] make an model object (e.g. nlme) available in a user defined function (xyplot related)
Dear all, When I construct an nlme model object by calling nlme(...)->mod.nlme, this object can be used in xyplot(). Something like xyplot(x,y,...... ...... ind.predict<-predict(mod.nlme) ...... ) is working fine in console environment. But the same structure is not working in a user defined function. It seems the "mod.nlme" created in a user defined function can not be called in xyplot(). Why is that? Appreciate any comment. (The error message says " Error in using packet 1, object "model" not found") Thanks. Jun Shen
Deepayan Sarkar
2010-Jul-12 06:05 UTC
[R] make an model object (e.g. nlme) available in a user defined function (xyplot related)
On Mon, Jul 12, 2010 at 2:51 AM, Jun Shen <jun.shen.ut at gmail.com> wrote:> Dear all, > > When I construct an nlme model object by calling nlme(...)->mod.nlme, > this object can be used in xyplot(). Something like > > xyplot(x,y,...... > ...... > ind.predict<-predict(mod.nlme) > ...... > ) is working fine in console environment. > > But the same structure is not working in a user defined function. It > seems the "mod.nlme" created in a user defined function can not be > called in xyplot(). Why is that? Appreciate any comment. (The error > message says " Error in using packet 1, object "model" not found")Quoting from the footer: PLEASE [...] provide commented, minimal, self-contained, reproducible code. -Deepayan> Thanks. > > Jun Shen > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >