[英]How to load .Rprofile and .Renviron files from an existing R project in JupyterLab?
I currently have an R project that I created in Rstudio.我目前有一个在 Rstudio 中创建的 R 项目。 For this project I created an .Rprofile file.
对于这个项目,我创建了一个 .Rprofile 文件。 Lately, I've been using JupyterLab to test things, and while I set the same working directory (
setwd("~/path/to/project")
) as the same as the project I created in RStudio, the R session in JupyterLab doesn't read the project's .Rprofile.最近,我一直在使用 JupyterLab 进行测试,虽然我设置了与我在 RStudio 中创建的项目相同的工作目录(
setwd("~/path/to/project")
),但在 JupyterLab 中设置了 R 会话不读取项目的 .Rprofile。
How can share a project's .Rprofile and .Renviron files between RStudio and JupyterLab?如何在 RStudio 和 JupyterLab 之间共享项目的 .Rprofile 和 .Renviron 文件?
You can load the files manually, eg in your first Jupyter cell:您可以手动加载文件,例如在您的第一个 Jupyter 单元中:
source("/path/to/.Rprofile")
readRenviron("/path/to/.Renviron")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.