generated from nfidd/nfidd
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgetting-set-up.qmd
69 lines (46 loc) · 3.37 KB
/
getting-set-up.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Overview
Each session in this course uses R code for demonstration.
All the content is self-contained within a R software package designed for the course and uses notebooks for each session.
If you would like to you can follow the course material without installing any software or running any code.
However, if you would like to run the code yourself, you will need to follow the instructions below.
# Getting R
- [R](http://cran.r-project.org) is used as the main programming language. Please install at least version: R-4.2.0.
- [RStudio](http://www.rstudio.com/products/rstudio/download/) is a popular graphic user interface (GUI). Its Visual Editor provides the best experience of going through this course. Please make sure you update RStudio to the latest version.
# Installing additional requirements
Before you get started with the course, you will first need to install the following software.
## Installation of the `nfidd` package
To install the packages needed in the course, including the `nfidd` package that contains data files and helper functions used throughout, you can use the `pak` package:
```{r install, eval=FALSE}
options(repos = c(
"CRAN" = "https://cloud.r-project.org",
"stan-dev" = "https://stan-dev.r-universe.dev",
"epiforecasts" = "https://epiforecasts.r-universe.dev"
))
install.packages("nfidd", dependencies = TRUE)
```
Then you can check that the installation completed successfully by loading the package into your **R** session:
```{r load, eval=FALSE}
library("nfidd")
```
# Accessing the course
To be able to use the code in each session, you will need a local copy of the course material.
- Directly download the course material:
::: callout-tip
[[**Download**]{.underline}](https://github.com/nfidd/ueifid/archive/refs/heads/main.zip)
:::
- Alternatively, if you are familiar with git you can clone the [repo](https://github.com/nfidd/ueifid).
- If you prefer, you can also view each session on the website, and copy-paste the code into your own R script. In that case you don't need to download the material.
- Tip: if you hover over each code chunk on the website you can use a "Copy" button at the top right corner.
### Interacting with a local copy of the course material
A benefit of downloading or cloning all the material is that you can interact with the session files directly.
In this course, all content is written using [R Notebooks](https://bookdown.org/yihui/rmarkdown/notebook.html).
This means that we can combine text with code and see the output directly.
The notebooks are then directly reproduced on the course website (for example, this page).
To interact with each session in the course, we recommend opening the RStudio Project file (`ueifid.RProj`) in the `ueifid` folder you have just downloaded.
Then you can choose to:
- View each session on the website, and copy-paste the code into your own R script.
- Tip: if you hover over each code chunk on the website you can use a "Copy" button at the top right corner.
- Open the R Notebook for each session.
- Each notebook is saved in `ueifid/sessions/` as a `.qmd` file.
- Execute code with the single green "play" button at the top-right corner of each code chunk ("Run current chunk"). You can also execute code line-by-line using `Ctrl/Cmd + Enter`.
- We suggest using "Visual" view for a better experience (top-left of the RStudio pane).