I would like to establish a workflow that makes my Quarto manuscripts reproducible for collaborators/consumers with the help of renv, but I can't seem to figure out what I'm doing wrong.
Basically I'm following the workflow described here: Structuring Reproducible Research Projects in R: A Workflow with renv, Quarto, and GitHub :: Posit Open Source to create a new Rproject, a quarto markdown with some analyses, and a virtual environment with renv. I commit all of these to a Github repo. However, when I clone the repo to a different machine and try to open the project by double-clicking the .Rproj file, I get "Error Starting R: The R session failed to start." The error log reads as follows:
ERROR system error 3 (The system cannot find the path specified) [path: C:/Users/myusername/Documents/.Rproj.user/31EED6CE/scratch-path]; OCCURRED AT auto __cdecl rstudio::core::FilePath::openForRead::<lambda_1>::operator ()(void) const src/cpp/shared_core/FilePath.cpp:1611; LOGGED FROM: class rstudio::core::json::Object __cdecl rstudio::session::projects::`anonymous-namespace'::projectConfigJson(const struct rstudio::core::r_util::RProjectConfig &) C:\Users\jenkins\workspace\ide-os-windows\rel-globemaster-allium\src\cpp\session\projects\SessionProjects.cpp:522
Deleting the .Rprofile (which only contains one line source("renv/activate.R")) resolves the startup error, but then I need to call renv::restore() manually.
Both machines have the same R version 4.5.2. I didn't check whether the renv versions are the same, but as far as I understand, renv/activate.R should handle the renv version, no?
I feel like I'm missing an obvious thing here to really use renv as it is intended. Any help is appreciated.