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
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
: 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
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
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
/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
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, . ~ . -
: '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
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 +
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
10 matches
Mail list logo