1

I currently have an R project that I created in Rstudio. For this project I created an .Rprofile file. 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.

How can share a project's .Rprofile and .Renviron files between RStudio and JupyterLab?

Phil
  • 7,287
  • 3
  • 36
  • 66
Pål Bjartan
  • 793
  • 1
  • 6
  • 18
  • Once you call `setwd` it’s already too late: the session has already started and read the configuration files *at that time*. You’ll need to find a way in Jupyter of *starting* your R session in the correct project folder. – Konrad Rudolph Nov 04 '21 at 13:17

1 Answers1

4

You can load the files manually, e.g. in your first Jupyter cell:

source("/path/to/.Rprofile")
readRenviron("/path/to/.Renviron")
danlooo
  • 10,067
  • 2
  • 8
  • 22