Displaying 1 result from an estimated 1 matches for "testvar_2".
Did you mean:
testvar2
2008 Aug 26
1
environments
Hi there,
I try to understand the usage of environments but I'm not sure if I get it. I
wrote a test script like this:
testenv <- new.env(environment())
myfun <- function(x) {
print(testvar)
testenv$testvar_2 <- 20
}
environment(myfun) <- testenv
testenv$testvar <- 10
myfun("hello")
ls(envir = testenv)
Now, I was wondering if there is any way to create new variables in my
environment without this "testenv$...". I know that I can access it that way if
I do an attach(teste...