grattan / R_at_Grattan

Using R at Grattan
https://grattan.github.io/R_at_Grattan/
Creative Commons Zero v1.0 Universal
7 stars 3 forks source link

should we load packages in each chapter? #14

Closed MattCowgill closed 5 years ago

MattCowgill commented 5 years ago

Three options:

  1. Load packages once, at the top of the document;
  2. Load packages once per chapter, at the top of the chapter; or
  3. Load packages once, when they are introduced / first used.

A related question is whether each .Rmd document should be knit in a new session (the way it's currently structured they're knit in one session, so packages loaded in chapter 1 are available in chapter 2 etc.).

MattCowgill commented 5 years ago

So we've decided:

MattCowgill commented 5 years ago

PS with this in mind, I will change the settings so that the book builds one chapter at a time (rather than combining the chapters into one and then building). This will be a way to check that we've loaded all the necessary packages in each chapter, because if we forget one then it won't build.