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

What is the best data flow for the document? #8

Closed wfmackey closed 3 years ago

wfmackey commented 5 years ago

The whole-document project is built up from chapter 1 to chapter X. But we also want people to be able to jump in a read a section (e.g. go straight to the Data Visualisation section).

So each chapter needs to have a 'load packages and read this data' bit at the start. And therefore a 'write this data' section at the end of each section (although this could be hidden).

Should it be before the first code chunk in its own code chunk:

... First, read the data generated in the previous chapters and load the required packages:

library(tidyverse)
data <- read_csv("data/02_viz_data.csv")

And should it be a .csv file? Probably.

MattCowgill commented 5 years ago

I think yes (load it in its own chunk, the first code chunk in each file/chapter) and yes (use .csv files). We should also (in the 'advanced' bits somewhere) cover the benefits of using other file formats, like .fst that I used a lot with the tax stuff