I'm working in R, and I want to do, for example,
printx <- function() {
x <- 1
printy()
return(x)
}
printy <- function() {
print(x)
}
because I don't want to keep passing around tons of variables (also, there is no x in the global environment). Is there a way to do this? All functions can access the global environment but what about the ones between the function's environment and the global?