A few month ago I replaced every setwd
and every absolute path in my code by relative paths using the here
package. It does work very well generally but there is still an issue.
I’m not using R Projects for this (because of different reasons), so I set up a .here
file. If I start RStudio
by opening one file out my project folder this works great, as the right root folder gets detected. If I open RStudio
and then start using my scripts the here function searches in my default working directory and therefore none of my paths work correctly.
Is there an elegant way to deal with that? Do I miss a feature of the here
package?
The idea is really great and way better than setting the working directory every time, but right now I have to close RStudio
every time i switch between projects and I always have to remember to start RStudio
by opening a file out of my project...
Thank in advance!