gt; *Sent:* Friday, August 16, 2013 1:55 PM
> *To:* William Dunlap
> *Cc:* r-help@r-project.org
> *Subject:* Re: [R] A question about using delayedAssign
>
> ** **
>
> Hi Bill,
>
> Thanks. According to the output, the assignment was triggered immediately
> after
Hi Duncan,
I did nothing between running the first two and the last two. The following
is the output:
> msg <- "old"
> delayedAssign("x", msg)
> msg <- "new!"
> x
[1] "new!"
> msg <- "old"
> delayedAssign("x", msg)
> msg <- "new!"
> x
[1] "old"
Thanks,
Gang
2013/8/16 Duncan Murdoch
> On 13-0
})
> > f <- function(p) paste(x, p)
> > f("qwerty")
> Assigning 'msg' to 'x' now
> [[1]]
> f("qwerty")
>
> [[2]]
> paste(x, p)
>
> [[3]]
> print(sys.calls())
>
> [1] "old qwerty"
> > x
> [1]
Software
wdunlap tibco.com
From: Gang Peng [mailto:michael.gang.p...@gmail.com]
Sent: Friday, August 16, 2013 1:55 PM
To: William Dunlap
Cc: r-help@r-project.org
Subject: Re: [R] A question about using delayedAssign
Hi Bill,
Thanks. According to the output, the assignment was triggered immediately
now
[[1]]
f("qwerty")
[[2]]
paste(x, p)
[[3]]
print(sys.calls())
[1] "old qwerty"
> x
[1] "old"
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-----
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.
On 13-08-14 9:11 PM, Gang Peng wrote:
I run the examples in delayedAssign:
msg <- "old"
delayedAssign("x", msg)
msg <- "new!"
x
If I run these four commands together, x is "new". If I run the first two
commands first and then run the last two commands, x is "old".
I just cannot figure out why.
I run the examples in delayedAssign:
msg <- "old"
delayedAssign("x", msg)
msg <- "new!"
x
If I run these four commands together, x is "new". If I run the first two
commands first and then run the last two commands, x is "old".
I just cannot figure out why.
Thanks.
Gang
[[alternative HT
7 matches
Mail list logo