Re: [R] About the scope of a variable and the save() method

2012-09-29 Thread Duncan Murdoch
On 12-09-28 11:51 PM, Qiang Wang wrote: In the following test, the variable x is supposed to be modified within the function test.save.x. It works as expected util using the save command. # initialize x.file x <- 1 save(x, file="x.file") rm(x) # Remove x from R_GlobalEnv exists("x") # FALSE # d

[R] About the scope of a variable and the save() method

2012-09-29 Thread Qiang Wang
In the following test, the variable x is supposed to be modified within the function test.save.x. It works as expected util using the save command. # initialize x.file x <- 1 save(x, file="x.file") rm(x) # Remove x from R_GlobalEnv exists("x") # FALSE # define test test.save.x <- function(){ save