Let's say I have a function that initializing a new environment:
init <-function()
{
e <- new.env()
}
Also, the init function lives in another .R file
Then, after it is initialized, I want to start using it in other function calls in different files like
init.main <- function(e)
{
e$data <- list()
e$number <- 0
}
However, this will throw an error saying object e is not found. I presume this is because e is only locally initialized, but if I were to use a package that relies solely on function calls, how would I get the functions to be able to talk to each other and use the same environment?