data

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

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:

train_tib <- here::here("data/dog_training.csv") |> 
  read_csv()

For the exercise data, import using this code:

exercise_tib <-  here::here("data/exercise.csv") |> 
  read_csv() |>
  dplyr::mutate(
    id = as_factor(id),
    intervention = as_factor(intervention) |>  fct_relevel("Wait list"),
    time = as_factor(time) |> fct_relevel("Baseline", "1 month", "6 months", "12 months")
  )

This code reads in the data and converts the variables intervention and time to factors (categorical variable). It uses fct_relevel to set the order of the levels of the factor intervention to be wait list and intervention. Similarly, the order of the levels of the factor time are set as baseline, 1 month, 6 months, 12 months.



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.