[Rd] nlme: bug in getCovariateFormula (PR#1038)
Tue, 31 Jul 2001 16:10:54 -0400
It looks clunky, but you could maintain consistency across S and R forms
R. Woodrow Setzer, Jr. Phone:
Experimental Toxicology Division Fax: (919) 541-5394
NHEERL MD-74; US EPA; RTP, NC 27711
<firstname.lastname@example.org To: Peter Dalgaard BSA <email@example.com>
c.edu> cc: Woodrow Setzer/RTP/USEPA/US@EPA, firstname.lastname@example.org,
Sent by: Remail@example.com
firstname.lastname@example.org Subject: Re: [Rd] nlme: bug in getCovariateFormula (PR#1038)
Peter Dalgaard BSA <email@example.com> writes:
> Setzer.Woodrow@epamail.epa.gov writes:
> > The final line in getCovariateFormula() in the nlme package (version
> > 3.1-16) is:
> > eval(parse(text = paste("~", deparse(form))))
> > however, if deparse(form) exceeds 'width.cutoff (which defaults to
> > this results in inappropriately placed "~" signs:
> > For example, in my application with the error, form is
> > UnCompetitive(MethoxyresorufinConc, InhibitorConc, Vmax, Km, Ki)
> > the result of the paste() operation in the last line of
> > is:
> > > paste("~",deparse(form))
> >  "~ UnCompetitive(MethoxyresorufinConc, InhibitorConc, Vmax, Km, "
> >  "~ Ki)"
> > extending width.cutoff gives the intended value:
> > > paste("~",deparse(form,width.cutoff=500))
> >  "~ UnCompetitive(MethoxyresorufinConc, InhibitorConc, Vmax, Km,
> > Seems a bit risky for an enforced cutoff in deparse, though.
> parse(...deparse(...)) always looks wrong to me anyway. Couldn't one
> use something like
> f <- ~1
> f[] <- form
> eval(substitute(~form)) # that's not going to work in S, though...
Exactly. The code was originally written for S and ported to R. Some
of the contorted expressions were things that we found by
experimentation would work in both systems.
> (What is the eval for? Doesn't usually do anything to a
> formula argument.)
In Sv3 at least it assigns a class to the object.
I'll change it to eval(substitute(~form)) for the R package.
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: firstname.lastname@example.org