Imagine that I have a function:
foo <- function(){
i <- 1
i <- i + 1
return
}
And then I want to be able to call and change i
from outside the function without returning it:
print(i)
Should return 2
i <- i + 1; print(i)
Should return 3
Thanks