data

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

Set up an r rstudio() project in the way that I recommend in this video, 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:

eel_tib <- here::here("data/eel.csv") |> 
  read_csv() |> 
  mutate(
    cured = as_factor(cured) |>  fct_relevel("Not cured"),
    intervention = as_factor(intervention) |>  fct_relevel("No treatment"),
  )

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

To read in the second data file use

penalty_tib <- here::here("data/penalty_shootout.csv") |> 
  read_csv() |> 
  mutate(
    scored = as_factor(scored) |>  fct_relevel("Missed penalty")
  )

This code reads in the data and converts the variable scored to a factor (categorical variable) and uses fct_relevel() to set the the levels of the factor to be ["Missed penalty"]{.alt}.



Try the discovr package in your browser

Any scripts or data that you put into this service are public.

discovr documentation built on Feb. 5, 2026, 5:07 p.m.