Search code examples
rrstudio

Set the Rstudio files pane directory from the R console?


Is there any interaction from R to RStudio possible?

I would really like, for example, to set the RStudio files pane directory from the R console, like setFilesPane(getwd()) or such. I haven't found anything though.

Edit: To clarify: In RStudio there is a "files pane" (bottom right)

enter image description here

This can be navigated like any file explorer. However I would like to set the files pane directory (the directory whose contents are shown in the files pane) from my R code instead of having to navigate to my project folder by hand every time. Is there any way to do this?


Solution

  • rstudioapi::filesPaneNavigate() ought to do what you're looking for.