参考文档:https://support.posit.co/hc/en-us/articles/1500007929061-Using-Python-with-the-RStudio-IDE
1、Rstudio中globalstudio中global options配置python interpreter ---- 地址:C:/Users/18308/anaconda3/python.exe
2、安装包:install.packages("reticulate")
3、library(reticulate)
4、reticulate::repl_python() #切换到python,这时就可以用啦
5、exit #退出python,回到R语言