Re: [R] strange behaviour when sourcing inside function

2012-08-23 Thread Jannis
Thanks for your reply! You may be correct, but the documentation of "source" reads as whether the opposite is the case regarding the use of TRUE and FALSE, doesn't it? Your interpretation may be correct (it would be also in line with my inutive interpretation of the combination of the word loc

Re: [R] strange behaviour when sourcing inside function

2012-08-22 Thread Noia Raindrops
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

[R] strange behaviour when sourcing inside function

2012-08-22 Thread Jannis
Dear R community, I encounter a problem that is counterintuitive to my understanding of the documentation of source and the "local" argument of that function. With the following code, I would expect the content of "test.R" to be evaluated inside the environment of the function "test". This, h