How to use the workshop materials

Although the formatted code pages (here and here) show the code step-by-step, in order to make changes to the code or to run it yourself, you need to load the raw code into RStudio.

This page shows a step-by-step overview of doing so.

Step 1

Starting from the homepage of the Github repository, we navigate to the “Code” folder.

Step 2

There, we navigate to the folder for the 2018 Workshop (of course, to load up 2017’s code, one would navigate to the respective folder).

Step 3

While the frontpage links to the “Formatted code 2018.md” file, this file does not easily allow you to load code into R. Instead, we navigate to the “Raw” folder.

Step 4

In the “Raw” folder, we click on the link to the .R file containing the full code.

Step 5

Unfortunately, it’s not possible to download the .R file very easily. Instead, we click on the “Raw” button. You can also try copying the code from this window if you prefer.

Step 6

The code will look like this, and the page will only contain this plaintext version of the code.

Step 7

We select all code on this page (in Windows, this is easiest with “Ctrl+A”) and copy it.

Step 8

Then, we boot up RStudio.

Step 9

And we create a new, empty script file (on Windows, pressing “Ctrl + Shift + N” also does the trick).

Step 10

Finally, we paste the copied code into this new script file. You can edit and save things as you see fit. You can run sections of code by selecting the relevant lines and pressing “Run” or pressing “Ctrl + Enter” on Windows.