Last Saturday, February 23, 2019, took place the R Forwards Women’s Package Workshop in Chicago at Center for Spatial Data Science, where Angela Li (CivicAngela) and Stephanie Kirmer (data_stephanie) conducted the workshop. 40 R-Ladies attended from different parts of the Chicago area to increase their abilities with R.
What do we learn?
We learned about packages, which are the fundamental units of reproducible R code. Also, we worked on how to create our package, the documentation associated and how to include a unit test to the process.
We saw a variety of subjects in a friendly and collaborative environment. This course was very hands on, and both instructors solved many questions, or for the person sitting next to you. Both Angela and Stephanie presented each subject, and after that, we learned by doing simple exercises about the matter, and if eventually, you can not have any idea about how to continue you can ask for help about how to solve the problem. Just keep going and keep learning.
Material for this workshop
You can find all the material of the course in this link: Chicago 2019 Forwards Workshop.
Allow me to introduce the 5 decks presented during the workshop:
First Deck: Package Development
Check the presentation here:
This presentation is about R packages, Angela suggested to check how many R packages have already installed on our computer (you can’t believe the numbers :) ), the most common sources for R packages (Cran and Github), and an explanation of the difference (and similarities) between developing a package and developing a script.
Takeaways:
- A review for R package from the theory
- Use of several commands like:
R.home()
,list.files(R.home())
,R.version
Second Deck: Packages & R Code
During this second part, Angela revisited the definition of a package. Also, she analyzed the reasons to use RStudio projects. After this introduction, we started with the process of building a simple package.
Later Stephanie took over explaining what git and GitHub are, and also she spent a moment speaking about version control, ending this second part making a project in RStudio from our repo.
Check the presentation here
Takeaways:
- We learned more about the package usethis (for example
usethis::create_package("~/Desktop/mypackage")
)
- How to create our first package
- How to make a project in RStudio from our repo
- Useful resource: Happy Git with R
- Useful resource II: Excuse me, do you have a moment to talk about version control?
Third Deck: Unit Test
During this third part, we reviewed the reason-why is a great idea to use unit test: because it is an excellent way to be sure that our functionalities continue working after each change.
We also tested the coverage for our package. As a final recommendation, we should include checking our work as a regular part of the iterative process to develop a package (or in any development).
Check the presentation here:
Takeaways:
- Theory and practice about how to include unit test in your code
- Useful resource: Testing
Fourth Deck: Documentation
During this fourth part, Stephanie spoke about documentation and why it is always a good idea to include it in your development process: because documentation is the way to preserve the information about the tools. She reviews Markdown and Roxygen, and also we opened up some function in R to check the Roxygen header and read the documentation, later we included a header in some of the functions created along the workshop. Also, we used Vignettes, Read.me and news to explain how our packages work.
Check the presentation: here
Takeaways:
- How to document data objects
- How to document classes and methods objects
- How to document packages objects
- Information about Vignettes
Additional Materials:
There are a lot of resources to continue digging into all the concept presented, some of them are: