Prereqs
To-do
Ensure you have R and RStudio installed. You don’t need the most recent version of either. I’m currently running R version 4.4.1 “Race for Your Life” and RStudio version 2026.07.
Install (or update!) the packages we’re going to use. Even if you are certain you already have all these packages on your system, it’s worth running install.packages() again, just to make sure you have recent versions.
install.packages(c("forecast", "fredr", "imputeTS",
"rlang", "roxygen2", "styler", "testthat",
"tidyverse", "usethis", "vdiffr"))
- [Optional, but recommended] Make sure your system is prepped to build more complex packages. We’re not going to get into C/C++ packages here, but it’s good to have the machinery to do more in-depth stuff. You can check your system’s status with the
devtools::has_devel()function. If you don’t get a positive response from that function, Jenny Bryan has instructions for getting up to speed:
Background
I am assuming you have a baseline familiarity with
- R as a language
- Writing functions
- Markdown (RMarkdown/Quarto/plain Markdown)
- git
Catch up
I’ll do a little bit of review of each of those topics, but if they are totally new to you, here is some background reading to help you get caught up.
- R as a language
- Writing functions
- DRY
- Functions chapter of R for Data Science
- What makes a good function?, Hadley Wickham
- Nick Tierney’s Practical Functions, Practically Magic
- Markdown
- git