Interactive Course

Developing R Packages

Create and share your own R Packages!

  • 4 hours
  • 16 Videos
  • 56 Exercises
  • 1,994 Participants
  • 4,200 XP

Loved by learners at thousands of top companies:

airbnb-grey.svg
intel-grey.svg
forrester-grey.svg
rei-grey.svg
deloitte-grey.svg
whole-foods-grey.svg

Course Description

In this course, you will learn the end-to-end process for creating an R package from scratch. You will start off by creating the basic structure for your package, and adding in important details like functions and metadata. Once the basic components of your package are in place, you will learn about how to document your package, and why this is important for creating quality packages that other people - as well as your future self - can use with ease. Once you have created the components of your package, you will learn how to test they work properly, by creating tests, running checks, and building your package. By the end of this course you can expect to have all the necessary skills to create and share your own R packages.

  1. 1

    The R Package Structure

    Free

    In this chapter, you will learn the basics of creating an R package. You will learn about the structure of R packages, set up a package, and write a function and include it in your package. You will also learn about the metadata stored in the DESCRIPTION and NAMESPACE files.

  2. Checking and Building R Packages

    In this chapter, you will learn about how to run checks to ensure that your R package is correctly structured and can be installed. You will learn how to correct common problems, and get your package ready to be built so it can be shared with others.

  3. Documenting Packages

    In this chapter, you will learn how to document your package. You will learn why documentation is important, and how to provide documentation for your package, its functions, and other components. You will also learn about what it means to export a function and how to implement this in your package.

  4. Adding Unit Tests to R Packages

    In the final chapter, you will learn how to add tests to your package to ensure your code runs as expected if the package is updated or changes. You will look at how to test functions to ensure they produce expected values, and also how to test for other aspects of functionality such as expected errors. Once you've written tests for your functions, you'll finally learn how to run your tests and what to do in the case of a failing test.

  1. 1

    The R Package Structure

    Free

    In this chapter, you will learn the basics of creating an R package. You will learn about the structure of R packages, set up a package, and write a function and include it in your package. You will also learn about the metadata stored in the DESCRIPTION and NAMESPACE files.

  2. Documenting Packages

    In this chapter, you will learn how to document your package. You will learn why documentation is important, and how to provide documentation for your package, its functions, and other components. You will also learn about what it means to export a function and how to implement this in your package.

  3. Checking and Building R Packages

    In this chapter, you will learn about how to run checks to ensure that your R package is correctly structured and can be installed. You will learn how to correct common problems, and get your package ready to be built so it can be shared with others.

  4. Adding Unit Tests to R Packages

    In the final chapter, you will learn how to add tests to your package to ensure your code runs as expected if the package is updated or changes. You will look at how to test functions to ensure they produce expected values, and also how to test for other aspects of functionality such as expected errors. Once you've written tests for your functions, you'll finally learn how to run your tests and what to do in the case of a failing test.

What do other learners have to say?

Devon

“I've used other sites, but DataCamp's been the one that I've stuck with.”

Devon Edwards Joseph

Lloyd's Banking Group

Louis

“DataCamp is the top resource I recommend for learning data science.”

Louis Maiden

Harvard Business School

Ronbowers

“DataCamp is by far my favorite website to learn from.”

Ronald Bowers

Decision Science Analytics @ USAA

Aimee Gott
Aimee Gott

Head of Skill Assessment Content at DataCamp

Aimee is the Head of Skill Assessment Content at DataCamp. Prior to joining DataCamp she was the Education Practice Lead at Mango Solutions. Aimee is a co-author of SAMS Teach Yourself R in 24 Hours.

See More
Nic Crane
Nic Crane

Data Scientist at Elucidata

Nic Crane is a Data Scientist at Elucidata, and has formerly worked for Mango Solutions and IBM. She is passionate about learning and teaching all things data science.

See More
Collaborators
  • Richie Cotton

    Richie Cotton

  • Sumedh Panchadhar

    Sumedh Panchadhar

  • Eunkyung Park

    Eunkyung Park

Icon Icon Icon professional info