## Class

Reopen your `comp-sds` project and save this `.Rmd` to the `reports` folder. When working through the materials from this session run each code chunk separately by clicking the small green arrow beside each code chunk. By default I have set `eval=FALSE` on most code chunks, so when you knit the code chunk will not execute.

The technical element demonstrates how the plots and uncertainty estimates of STATS19 road crash data introduced in the session can be produced.

### Setup

The code block below points to the packages you need to do the work discussed in the session. Uncomment the `intall_packages()` lines if you have not already downloaded `ggdsist`, `gganimate` and `distributional`.

```{r setup, echo=TRUE, eval=FALSE, message=FALSE}
library(tidyverse) # Bundle of packages for doing modern data analysis.
library(sf) # Spatial operations
library(here)
library(fst) # For reading/writing large files.
library(lubriadate) # For working with dates.
library(rsample) # For resampling.
# install.packages("ggdist")
library(ggdist) # For uncertainty visualization.
# install.packages("distributional")
library(distributional) # Dependency for ggdist.
# install.packages("gganimate") # For HOPs.
library(gganimate)
```

### Import

Run the code block below to download and process the STATS19 data.

```{r download-data, echo=TRUE, eval=FALSE, message=FALSE}
# Dataset of pedestrian-vehicle crashes.
url <- "https://www.roger-beecham.com/datasets/ped_veh.fst"
download.file(url, here("data", "ped_veh.fst"))
ped_veh <- fst::read_fst(here("data", "ped_veh.fst"))
```
