Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Peter Meilstrup
On Fri, Jun 28, 2013 at 3:07 PM, Ben Bolker wrote: > On 13-06-28 03:57 PM, Peter Meilstrup wrote: > > Well, once you begin messing with eval.parent(), you _are_ telling R > > what environment to work in, and things have the potential to go wrong > > at that point because you're telling R to work

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Ben Bolker
On 13-06-28 03:57 PM, Peter Meilstrup wrote: > Well, once you begin messing with eval.parent(), you _are_ telling R > what environment to work in, and things have the potential to go wrong > at that point because you're telling R to work in environment you don't > know anything about. Having to be

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Peter Meilstrup
Well, once you begin messing with eval.parent(), you _are_ telling R what environment to work in, and things have the potential to go wrong at that point because you're telling R to work in environment you don't know anything about. Having to be explicit with a :: is just compensating for an earlie

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Ben Bolker
On 13-06-28 01:56 PM, Duncan Murdoch wrote: > On 28/06/2013 12:42 PM, Ben Bolker wrote: >> Duncan Murdoch gmail.com> writes: >> >> > >> >> [snip] >> > >> > The other choice is to use the explicit ::, i.e. >> > >> > mc[[1]] <- quote(lmer::lFormula) >> > >> > This would be the solution I'd prefer, b

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread peter dalgaard
On Jun 28, 2013, at 18:42 , Ben Bolker wrote: > Duncan Murdoch gmail.com> writes: > >> > > [snip] >> >> The other choice is to use the explicit ::, i.e. >> >> mc[[1]] <- quote(lmer::lFormula) >> >> This would be the solution I'd prefer, but you seem to have some >> prejudice against :: .

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Duncan Murdoch
On 28/06/2013 12:42 PM, Ben Bolker wrote: Duncan Murdoch gmail.com> writes: > [snip] > > The other choice is to use the explicit ::, i.e. > > mc[[1]] <- quote(lmer::lFormula) > > This would be the solution I'd prefer, but you seem to have some > prejudice against :: . > I just thought that

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Ben Bolker
Duncan Murdoch gmail.com> writes: > [snip] > > The other choice is to use the explicit ::, i.e. > > mc[[1]] <- quote(lmer::lFormula) > > This would be the solution I'd prefer, but you seem to have some > prejudice against :: . > I just thought that the whole point of using the machinery

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Duncan Murdoch
On 13-06-27 11:49 PM, Ben Bolker wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The lmer() function in the lme4 package has some code of the form mc <- match.call() mc[[1]] <- as.name("lFormula") lmod <- eval(mc, parent.frame(1L)) this is a fairly common idiom in R, found e.g. in

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Peter Meilstrup
On Thu, Jun 27, 2013 at 8:49 PM, Ben Bolker wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > The lmer() function in the lme4 package has some code of the form > > mc <- match.call() > mc[[1]] <- as.name("lFormula") > lmod <- eval(mc, parent.frame(1L)) > > this is a fairly common

[Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-27 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The lmer() function in the lme4 package has some code of the form mc <- match.call() mc[[1]] <- as.name("lFormula") lmod <- eval(mc, parent.frame(1L)) this is a fairly common idiom in R, found e.g. in lm(), used when one wants to pass all of the