I have a R script (regular .R file) which is within an R project so if I open the R project and run interactively, the working directory is automatically set to the directory of the project. However, if I try to use the "Compile Report" feature in RStudio, the working directory is set to the folder where the program is. Why is it not set where the project is?
My folder structure looks like this:
MainFolder.Rproj
Programs
-- Program.R
Data
-- SomeCSVs.csv
I can make this work by putting the program instead in the main folder. Any other suggestions?