My First R Package: A Short Course

A 2-Day Livestream Seminar Taught by Vincent Arel-Bundock, Ph.D.

Writing R packages is the perfect way to level up your programming skills while unlocking many benefits. Doing so can enhance your productivity by reducing the need to rewrite similar code over and over. R packages improve the portability, replicability, and accessibility of your work, which can streamline collaborations between you, your team members, and the broader data analysis community. Packaging code can make it more reliable by encouraging the adoption of software development best practices, such as tests, assertions, and documentation. Finally, sharing your work in a professionally packaged format can significantly boost your credibility and visibility, within your organization and beyond.

“My First R Package” is a two-day course designed to guide you through the creation of your very own R package. You will learn the software development skills needed to create brand-new packages or to improve existing ones. The course covers all the essentials: how to organize code efficiently, manage dependencies, and how to write tests, assertions, and documentation. We will also briefly outline the steps required to distribute your package on GitHub, CRAN, and a dedicated website.

Throughout the course, practical exercises will allow you to apply what you’ve learned by developing a simple R package step by step. You will gain hands-on experience in using tools like devtools and usethis for package creation, roxygen2 for documentation, testthat for testing, and checkmate to make your functions more robust. These activities are designed to reinforce theoretical concepts by putting them in practice, enhancing your learning experience and providing you with the confidence to work on your own projects.

By the end of this course, you will be fully equipped to create and maintain an R package, preparing you to contribute effectively to the R community or any data-driven projects you undertake in your organization. This course aims to empower you with the knowledge and skills to elevate your programming expertise in R.

Starting December 5, we are offering this seminar as an 8-hour synchronous*, livestream workshop held via the free video-conferencing software Zoom. Each day will consist of two 2-hour lecture sessions which include hands-on exercises, separated by a 30-minute break. You are encouraged to join the lecture live, but will have the opportunity to view the recorded session later in the day if you are unable to attend at the scheduled time.

*We understand that finding time to participate in livestream courses can be difficult. If you prefer, you may take all or part of the course asynchronously. The video recordings will be made available within 24 hours of each session and will be accessible for four weeks after the seminar, meaning that you will get all of the class content and discussions even if you cannot participate synchronously.

Closed captioning is available for all live and recorded sessions. Captions can be translated to a variety of languages including Spanish, Korean, and Italian. For more information, click here.

More Details About the Course Content

By the end of this course, you’ll have a solid foundation in R package development, enabling you to structure, document, and distribute your R software like a professional. This skill set will not only streamline your code development process but also enhance its reproducibility and utility, making your projects more impactful and widely accessible. With a good understanding of package anatomy, defensive programming, and effective testing practices, you’ll be ready to tackle R development challenges with assurance.

The course content includes:

  • Learning the structure and components of an R package.
  • Organizing your code efficiently.
  • Implementing software development best practices with unit tests and assertions.
  • Documenting the package to make it more understandable and useable.
  • Checklists of steps to distribute your package on GitHub, CRAN, and on a dedicated website.

You will also be introduced to several essential R packages and tools, including:

These resources are crucial for any R developer looking to professionalize their package development workflow and are integral to the practices taught in this course.

Computing

To actively participate in the hands-on exercises, it’s essential to have a computer with the latest version of R installed. For this course, you’ll also need the devtools, pkgload, usethis, roxygen2, testthat, checkmate, quarto, and altdoc packages, which are vital for R package development. Additionally, installing RStudio is recommended. This integrated development environment (IDE) enhances the ease of working with R, providing a more user-friendly interface for coding and package development. Both R and RStudio are free to download and are compatible with Windows, Mac, and Linux operating systems. The Git version control system is also recommended, although not required.

If you’d like to take this course but are concerned that you don’t know enough R, there are excellent on-line resources for learning the basics. Here are our recommendations.

Who Should Register?

This course is ideal for anyone interested in streamlining and sharing their data analysis workflow by creating R packages. Whether you’re a data scientist, a statistician, a researcher, or any professional involved in data analysis, this course will empower you to build robust tools which can be reused and shared with your team or the broader R community. The course will be especially beneficial for those looking to enhance the reproducibility and efficiency of their research or data projects through well-structured software.

While the course is structured to be accessible to a broad audience, you are expected to have a basic knowledge of R programming. You should be able to write your own functions, and be familiar at the level of our Introduction to R for Data Analysis, R for Stata Users, or R for SPSS Users courses or their equivalent. This foundational knowledge will help you grasp the concepts of R package development more effectively and allow you to fully engage with the course material.

Outline

Development environment

  • R Programming Environment
  • Essential Tools and Libraries

The Anatomy of an R Package

  • How to structure code efficiently in an R package
  • Dependency management

Writing robust code:

  • Assertions
  • Unit tests

Documentation:

  • Writing documentation with roxygen2

Distribution checklists:

Seminar Information

Thursday, December 5 –
Friday, December 6, 2024

Daily Schedule: All sessions are held live via Zoom. All times are ET (New York time).

10:30am-12:30pm (convert to your local time)
1:00pm-3:00pm

Payment Information

The fee of $695 includes all course materials.

PayPal and all major credit cards are accepted.

Our Tax ID number is 26-4576270.