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:
goggles_tib <- here::here("data/goggles.csv") |> read_csv() |> mutate( facetype = as_factor(facetype), alcohol = as_factor(alcohol) )
This code reads in the data and converts the variables alcohol and facetype to factors (categorical variable).
For the xbox data use this code (in which I have been explicit in setting certain categories as the first level of the factor using fct_relevel()):
xbox_tib <- here::here("data/xbox.csv") |> read_csv() |> mutate( game = as_factor(game) |> fct_relevel("Static"), console = as_factor(console) |> fct_relevel("Xbox One") )
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.