Closed sgaichas closed 6 years ago
"The chance of the setwd() command having the desired effect – making the file paths work – for anyone besides its author is 0%" - Jenny Bryan
I think in general we should avoid those types of functions (same with rm(list = ls()
, bookdown creates each rmd in a new environment, so it will be empty).
One of the huge advantages of bookdown is that file paths start in the project directory, so it's relatively easy to add a generic file path for data.
This is just so we remember to go back and fix it; setwd generates a warning in bookdown; it claims it resets the working directory back to the project directory but it might be safer to recode this using something like
read.csv(file.path(data.dir, "CB_HAB/filename"))
or temporarily rename data.dir to include the subdirectory. I'm just not sure this works with read_excel