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:
date_tib <- here::here("data/speed_date.csv") |> read_csv() |> mutate( strategy = as_factor(strategy) |> fct_relevel("Normal", "Hard to get"), looks = as_factor(looks) |> fct_relevel("Low", "Average", "High"), charisma = as_factor(charisma) |> fct_relevel("Low", "Average", "High"), )
This code reads in the data and converts the variables strategy, looks and charisma to be factors (categorical variable). It also uses fct_relevel() to set the order of the levels of each factor.
For the profile picture data use the code below. The variables rel_status and profile_pic are converted to factors and the reference category for each is set using fct_relevel():
profile_tib <- here::here("data/profile_pic.csv") |> read_csv() |> mutate( rel_status = as_factor(rel_status) |> fct_relevel("Single"), profile_pic = as_factor(profile_pic) |> fct_relevel("Alone") )
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.