I have been using r project file to automatically set the working directory to the current folder that contains the R script I am working on. I would like to try another approach so that my R script can run without RStudio.
Here is what I plan to do:
I add this R code to the beginning of every R script in my current folder:
I assume this will automatically set the working directory to my current folder for every R script. Are there any problems with this workflow?