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

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

* [download_festival.csv](https://www.discovr.rocks/csv/download_festival.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}
download_tib <- here::here("data/download_festival.csv") |> read_csv()
```

### Preparing data

To work *outside of this tutorial* you need to convert the ticket number (`ticket_no`) to a character variable (so `r rproj()` doesn't confuse it for a number) and convert `gender` to a categorical variable and set the order of factor levels to match the data in the `r rproj()` package. To do all of this, execute the following code:

```{r, eval=FALSE}
download_tib <- download_tib |> 
  dplyr::mutate(
    ticket_no = as.character(ticket_no),
    gender = as_factor(gender) |> fct_relevel("Male", "Female", "Non-binary")
  )

```