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:
scents_tib <- here::here("data/alien_scents.csv") |> read_csv() |> mutate( entity = as_factor(entity) |> fct_relevel("Human", "Shapeshifter", "Alien"), scent_mask = as_factor(scent_mask) |> fct_relevel("None", "Human", "Fox") )
This code reads in the data and converts the variables entity and scent_mask to a factor (categorical variable). It also uses fct_relevel to set the order of the levels of the factor entity to be human, shapeshifter, and alien. Similarly, the order of the levels of the factor scent_mask are set as none, human, and fox.
For the sniffer dogs data use the code below (which, like the code above converts the variable entity to a factor):
sniff_tib <- here::here("data/sniffer_dogs.csv") |> read_csv() |> mutate( entity = as_factor(entity) )
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.