Problem when knitting in R

They need not only to be here according to the OS, the RStudio working environment, as shown by getwd(), must also be set to

and keeping the two notions in synch is a bother. The bother can be minimal with

  1. Create a separate RStudio project for each set of scripts that will use various datasets.
  2. Create a directory data
  3. Copy the .csv and `xlsx’ files there; avoid embedded blanks in names
  4. Treat the folder as read-only or include it in git or another VCS.
  5. Create a sibling folder obj for any transformations to be saved as an rds object, and preserve the script that performs the transformations
  6. install.packages("here")
  7. Then, whatever working directory is set to, the target can be accessed simply: read.csv(here::here("data/QVI_purchase_behaviour.csv")