Re: [Rd] scoping/non-standard evaluation issue

2011-01-06 Thread Kenn Konstabel
the following seems an easy solution: f1 - function(mod){ subs - 1:10 toeval - quote(update(mod, subset=subs)) toeval$subset-subs eval(toeval) } f1(mod.2) When experimenting with this I once had (by mistake): mod.2 - lm(update(mod.1, . ~ . - Year + Year)) # instead of

Re: [Rd] scoping/non-standard evaluation issue

2011-01-06 Thread peter dalgaard
On Jan 6, 2011, at 13:11 , Kenn Konstabel wrote: the following seems an easy solution: f1 - function(mod){ subs - 1:10 toeval - quote(update(mod, subset=subs)) toeval$subset-subs eval(toeval) } f1(mod.2) Tere, Kenn! Yes, enforcing pass-by-value by pre-evaluating

Re: [Rd] scoping/non-standard evaluation issue

2011-01-05 Thread John Fox
: socserv.mcmaster.ca/jfox -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of peter dalgaard Sent: January-04-11 6:05 PM To: John Fox Cc: 'Sanford Weisberg'; r-devel@r-project.org Subject: Re: [Rd] scoping/non-standard evaluation

Re: [Rd] scoping/non-standard evaluation issue

2011-01-05 Thread John Fox
Sent: January-04-11 6:56 PM To: John Fox Cc: Sanford Weisberg; r-devel@r-project.org Subject: Re: [Rd] scoping/non-standard evaluation issue On Tue, Jan 4, 2011 at 4:35 PM, John Fox j...@mcmaster.ca wrote: Dear r-devel list members, On a couple of occasions I've encountered the issue

Re: [Rd] scoping/non-standard evaluation issue

2011-01-05 Thread peter dalgaard
Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Gabor Grothendieck Sent: January-04-11 6:56 PM To: John Fox Cc: Sanford Weisberg; r-devel@r-project.org Subject: Re: [Rd] scoping/non-standard evaluation issue On Tue, Jan 4, 2011 at 4:35 PM

Re: [Rd] scoping/non-standard evaluation issue

2011-01-05 Thread John Fox
/non-standard evaluation issue On Jan 5, 2011, at 14:44 , John Fox wrote: Dear Gabor, I used str() to look at the two objects but missed the difference that you found. What I didn't quite understand was why one model worked but not the other when both were defined at the command

[Rd] scoping/non-standard evaluation issue

2011-01-04 Thread John Fox
Dear r-devel list members, On a couple of occasions I've encountered the issue illustrated by the following examples: - snip --- mod.1 - lm(Employed ~ GNP.deflator + GNP + Unemployed + + Armed.Forces + Population + Year, data=longley) mod.2 - update(mod.1, . ~ . -

Re: [Rd] scoping/non-standard evaluation issue

2011-01-04 Thread John Fox
: 'Sanford Weisberg' Subject: [Rd] scoping/non-standard evaluation issue Dear r-devel list members, On a couple of occasions I've encountered the issue illustrated by the following examples: - snip --- mod.1 - lm(Employed ~ GNP.deflator + GNP + Unemployed

Re: [Rd] scoping/non-standard evaluation issue

2011-01-04 Thread peter dalgaard
On Jan 4, 2011, at 22:35 , John Fox wrote: Dear r-devel list members, On a couple of occasions I've encountered the issue illustrated by the following examples: - snip --- mod.1 - lm(Employed ~ GNP.deflator + GNP + Unemployed + + Armed.Forces + Population +

Re: [Rd] scoping/non-standard evaluation issue

2011-01-04 Thread Gabor Grothendieck
On Tue, Jan 4, 2011 at 4:35 PM, John Fox j...@mcmaster.ca wrote: Dear r-devel list members, On a couple of occasions I've encountered the issue illustrated by the following examples: - snip --- mod.1 - lm(Employed ~ GNP.deflator + GNP + Unemployed + +         Armed.Forces