Unexpected working directory in RStudio projects

Hello all,

I have a directory in my file system named My_Drive where I have several sub-directories, which are RStudio projects. I am unfortunately not sure which wrong manipulation I performed with the renv package, but it led to My_Drive becoming an RStudio project . Now, whenever I open any of projects inside it, the default working directory is now My_Drive. It's been going on for the past 2 days and my hack has been to manually set the working directory with setwd() before doing any kind of work.

I already deleted My_Drive.Rproj file as well as the . Rhistory , renv/ and .R.project.user/ inside My_Drive but RStudio still points to it whenever I open my other projects. Any help will be greatly appreciated...

... I am also worried that Jenny Bryan will set my computer on fire if I keep using setwd() as a hack.

I'm on POP_OS! which is based on Ubuntu 22.04.
I'm using RStudio 2023.03.0 Build 386 (from dailies.rstudio.com)

renv creates custom .Rprofile files, check for those

@andresrcs The problem was not solved by deleting the custom .Rprofile files created by renv, but you pointed me in the right direction. I was able to locate the main .Rprofile file for my R installation with usethis::edit_r_profile() and it turns out that a line was added to make My_Drive the default working directory. I commented out the line and now everything is back to normal.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.