Labcoat Leni solutions Chapter 1
This document contains abridged sections from Discovering Statistics Using R and RStudio by Andy Field so there are some copyright considerations. You can use this material for teaching and non-profit activities but please do not meddle with it or claim it as your own work. See the full license terms at the bottom of the page.
There are several ways to enter the Oxoby data, here’s one of them:
oxoby_tib <- tibble::tibble(.rows = 36) %>%
dplyr::mutate(
singer = c(rep("Bon Scott", 18), rep("Brian Johnson", 18)) %>% forcats::as_factor(),
offer = c(1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5)
)
# You can go on to save this tibble to a csv in your data folder using:
oxoby_tib %>%
readr::write_csv(., here::here("data/acdc.csv"))