Can you match the tidyverse function to the package name? A multiple choice quiz hacked together with {learnr}.
Can you always remember which tidyverse function comes from which tidyverse package? Inspired by frustrations of Ryan Timpe, Daniel McNichol, and others I'm sure.
The {learnr} package lets you build quizzes, obstensibly for learning about R. I wondered if you could use it to serve a randomised question about what function belongs to which tidyverse package. It's a bit hacky: you have to click the 'get question' button to begin and then 'start over' each time you want a new question.
You can read the accompanying blog post for more info on how it was built.
Install the package and run the app with the following commands:
install.packages(c("remotes", "pacman", "tidyverse", "learnr"))
to install {learnr} from CRAN (beware: this will install a lot of packages)remotes::install_github("matt-dray/tidyquiz")
to install this package from GitHublearnr::run_tutorial("tidy", package = "tidyquiz")
to open in your browser
The app is no longer hosted online.
Yes, if installing locally. This thing works on the fly. It fetches the tidyverse packages and creates questions and answers whenever you run generate_quiz()
. This means you should be prepared for all the tidyverse packages to be downloaded to your machine. On the plus side, functions presented to you in the quiz will always be current.
The list of packages can be found in tidyverse::tidyverse_packages()
. At time of writing (2019-03-17) the packages are:
"broom" "cli" "crayon" "dplyr" "dbplyr" "forcats"
"ggplot2" "haven" "hms" "httr" "jsonlite" "lubridate"
"magrittr" "modelr" "purrr" "readr" "readxl" "reprex"
"rlang" "rstudioapi" "rvest" "stringr" "tibble" "tidyr"
"xml2" "tidyverse"
There's only ever one correct answer from the four presented. If you are presented with a function that exists in multiple packages, the answer set will include one package it definitely exists in and three it definitely doesn't exist in.