RStudio: Running .Rprofile in source file location

23 views Asked by At

I have set up a workflow governed by a Makefile.

Under code/ I have multiple *.r scripts each typically responsible for creating one output file (typically an RData file but could also be csv exports or png images, any file in principle)

code/.Rprofile contains some helper functions to bootstrap the whole project directory system and sources some helper functions etc.

The scripts in code/ need this functionality to work properly.

RStudio has the convenient menu entry to set working directory to source file location.

But could I also make it run .Rprofile in that directory if found? Or really just start R a fresh from the directory of the source file?

0

There are 0 answers