---
title: "data"
author: "Andy Field"
output: learnr::tutorial
---

To work *outside of this tutorial* you need to download the following data file:

* [santas_log.csv](https://www.discovr.rocks/csv/santas_log.csv)

Set up an `r rstudio()` project in the way that [I recommend in this video](https://youtu.be/mqT7c17tofE?si=R0aSApz66fGQKESl), and save the data files to the folder within your project called [data]{.alt}. Place this code in the first code chunk in your `r quarto()` document:

```{r, eval=FALSE}
santa_tib <- here::here("data/santas_log.csv") |>
  read_csv() |>
   mutate(
    treat = as_factor(treat) |> fct_relevel("Pudding", "Mulled wine"),
    delivered = as_factor(delivered) |> fct_relevel("Not delivered", "Delivered")
  )
```

This code reads in the data and converts the variables `treat` and `delivered` to be factors (categorical variable). It also uses `fct_relevel()` to set the order of the levels of each factor.