Hello,

If argument 'local' is FALSE, 'source' function is evaluating the file in 
global environment
and object 'a' is not in global environment.

Function's environment is just local. And environment() in a function returns 
the function's environment.


test <- function () source("test.R", local = FALSE)
# test.R is evaluated in global environment.

test <- function () source("test.R", local = environment())
# environment() returns the envrionment of 'test' function.

test <- function () source("test.R", local = TRUE)
# this is same as above.

-- 
Noia Raindrops
noia.raindr...@gmail.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to