更改程序包全局变量

时间:2019-01-18 14:50:30

标签: r global-variables reticulate

是否可以更改仅在包中可见的全局变量?:

library(reticulate)

# access the variable - works
reticulate:::.globals$use_python_versions

# change the variable - doesn't work
reticulate:::.globals$use_python_versions = 'my_python_version/python'

非常感谢!

1 个答案:

答案 0 :(得分:0)

assign('use_python_versions','my_python_version/python', env=reticulate:::.globals)