0

I included the line

setwd("~/my project base dir")

within .Rprofile, but this has no effect on the file selector after I hit the top-right menu "Projects" to either open or create a new project.

I am running R 3.4.4, RStudio 1.1.442 on Ubuntu 16.04.4 LTS

Dan Reznik
  • 41
  • 6

1 Answers1

1

Using setwd() is sending a command to R, not RStudio, so I wouldn't expect that to have any effect. R is run as a separate process by RStudio.

I haven't checked the source code, but it looks like RStudio always starts looking for an existing directory in the current project directory if you already have a project open, or your home directory if not. If you want to create a new directory, it seems to offer first to create it in the same place as it did last time.

I don't think there's any RStudio API command to change any of this. But how often to you need to create new projects, anyway?

user2554330
  • 37,248
  • 4
  • 43
  • 90
  • It seems like this discussion might be helpful: https://stackoverflow.com/questions/22432344/how-do-you-change-the-default-directory-in-rstudio-or-r – Fred Boehm Mar 25 '18 at 16:10