Re: [R] A question about using delayedAssign

2013-08-16 Thread Gang Peng
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

Re: [R] A question about using delayedAssign

2013-08-16 Thread Gang Peng
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

Re: [R] A question about using delayedAssign

2013-08-16 Thread Gang Peng
}) > > 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]

Re: [R] A question about using delayedAssign

2013-08-16 Thread William Dunlap
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

Re: [R] A question about using delayedAssign

2013-08-16 Thread William Dunlap
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.

Re: [R] A question about using delayedAssign

2013-08-16 Thread Duncan Murdoch
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.

[R] A question about using delayedAssign

2013-08-14 Thread Gang Peng
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