I want to pass the content of an object that is defined outside a function to the function's body. My problem might be easier to understand with an example:
a <- 'hello world'
foo <- function() print(a)
rm(a)
foo()
Currently, this obviously throws an error, because a is not defined anymore when calling foo().
My desired outcome is that I want foo to look like function() print('hello world')