Building Tidy Tools
by Charlotte Wickham and Hadley Wickham
Please make sure you’ve installed the following packages:
install.packages("devtools") install.packages(c("bench", "fs", "ggplot", "glue", "grid", "lobstr", "rematch2", "sloop", "vctrs")) devtools::install_github("r-lib/itdepends")
# You may also need: install.packages(c("ggplot2", "dplyr", "stringr")) # And get the package we'll work with later: usethis::create_from_github("hadley/fordogs", fork = FALSE) # if you see an error about "unsupported protocol", try this: usethis::create_from_github("hadley/fordogs", fork = FALSE, protocol = "https")
If you’re all set, you might like to download the first set of slides.
Find our live coded notes in
notes/ as we commit them.
You can see the scripts we’ll work from in
script/, but we
recommend not reading too far ahead because you’ll find answers to some
of the exercises, and you’ll learn more if you try to work through them
Where to learn more
Workflow, devtools and usethis:
Interface: Tidyverse design guide, work in progress
Feel free to ask questions in the Building Tidy Tools Workshop RStudio Community thread.
This is a two-day hands on workshop for those who have embraced the tidyverse and now want to expand it to meet their own needs. We’ll discuss API design, functional programming tools, the basics of object design in S3, and the tidy eval system for NSE.
- Learn efficient workflows for developing high-quality R functions, using the set of conventions codified by a package. You’ll also learn workflows for unit testing, which helps ensure that your functions do exactly what you think they do.
- Master the art of writing functions that do one thing well and can be fluently combined together to solve more complex problems. We’ll cover common function writing pitfalls and how to avoid them.
- Learn how to write collections of functions that work well together, and adhere to existing conventions so they’re easy to pick up for newcomers.
You should take this workshop if you have experience programming in R and want to learn how to tackle larger scale problems. You’ll get the most from it if you’re already familiar with functions and are comfortable with R’s basic data structures (vectors, matrices, arrays, lists, and data frames). Note: There is ~30% overlap in the material with Hadley Wickham’s previous “R Masterclass”. However, the material has been substantially reorganised, so if you’ve taken the R Masterclass in the past, you’ll still learn a lot in this class.
Is this course for me?
Have you written a few of your own R functions? Are you ready to start sharing your code (or data) through R packages? Are you curious what you can do to make your first R packages easy for your users to use, and for you to maintain?
Materials will be made available on github. If you are using an organization-issued laptop, you may want to verify before you arrive that you can access GitHub.
The materials will evolve as the workshop approaches, so if you want to pre-download the materials, please wait until the day before the workshop.
|Time||Day One||Day Two|
|09:00 - 10:30||Introduction / The Whole Game (Charlotte)||Using the tidyverse in packages (Charlotte)|
|10:30 - 11:00||Coffee break||Coffee break|
|11:00 - 12:30||Testing (Charlotte)||Interface (Hadley)|
|12:30 - 13:30||Lunch break||Lunch break|
|13:30 - 15:00||Documentation / Sharing (Charlotte)||Types (Hadley)|
|15:00 - 15:30||Coffee break||Coffee break|
|15:30 - 17:00||Dependencies (Hadley)||OO programming / S3 (Charlotte)|
This course is led by friend of RStudio, Charlotte Wickham, a professor and award winning teacher and data analyst at Oregon State University, and co-taught by her brother Hadley Wickham, Chief Scientist at RStudio.
These materials closely follow https://github.com/hadley/tidy-tools
This work is licensed under a Creative Commons Attribution 4.0 International License.