NOAA-EDAB / tech-doc

Technical documentation for ecosystem reporting
https://noaa-edab.github.io/tech-doc
Other
8 stars 9 forks source link

recode without setwd() in MAB_HABs_indicator.Rmd line 57? #12

Closed sgaichas closed 6 years ago

sgaichas commented 6 years ago

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

slarge commented 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.