I want to pass a variable that's not in the R global environment into a python chunk (using reticulate). Here is an example:
library(reticulate)
newEnv <- new.env()
newEnv$x <- 9
z <- 3
print(r.newEnv$x)
This yields an error. Note that I also tried print(r.newEnv[['x']])
. Also, print(r.z)
gives 3.0
, as expected. Finally, I've played around with stuff like eval()
and constructing strings to pass to Python and so far no dice.