Subscribe now. Save 50% on DataCamp and commit to learning data science and analytics.

Offer ends in  days  hrs  mins  secs
Interactive Course

Object-Oriented Programming in R: S3 and R6

Manage the complexity in your code using object-oriented programming with the S3 and R6 systems.

  • 4 hours
  • 18 Videos
  • 56 Exercises
  • 9,577 Participants
  • 4,250 XP

Loved by learners at thousands of top companies:

ikea-grey.svg
t-mobile-grey.svg
intel-grey.svg
airbnb-grey.svg
ea-grey.svg
paypal-grey.svg

Course Description

Object-oriented programming (OOP) lets you specify relationships between functions and the objects that they can act on, helping you manage complexity in your code. This is an intermediate level course, providing an introduction to OOP, using the S3 and R6 systems. S3 is a great day-to-day R programming tool that simplifies some of the functions that you write. R6 is especially useful for industry-specific analyses, working with web APIs, and building GUIs. The course concludes with an interview with Winston Chang, creator of the R6 package.

  1. 1

    Introduction to Object-Oriented Programming

    Free

    Learn what object-oriented programming (OOP) consists of, when to use it, and what OOP systems are available in R. You'll also learn how R identifies different types of variable, using classes, types, and modes.

  2. Using R6

    Learn how to define R6 classes, and to create R6 objects. You'll also learn about the structure of R6 classes, and how to separate the user interface from the implementation details.

  3. Advanced R6 Usage

    Complete your mastery of R6 by learning about advanced topics such as copying by reference, shared fields, cloning objects, and finalizing objects. The chapter concludes with an interview with Winston Chang, creator of the R6 package.

  1. 1

    Introduction to Object-Oriented Programming

    Free

    Learn what object-oriented programming (OOP) consists of, when to use it, and what OOP systems are available in R. You'll also learn how R identifies different types of variable, using classes, types, and modes.

  2. Using S3

    S3 is a very simple object-oriented system that lets you define different behavior for functions, depending upon their input argument. This chapter explains how to use S3, and how generics and methods work.

  3. Using R6

    Learn how to define R6 classes, and to create R6 objects. You'll also learn about the structure of R6 classes, and how to separate the user interface from the implementation details.

  4. R6 Inheritance

    Learn how to inherit from an R6 class, and how the relationship between parent and child classes works.

  5. Advanced R6 Usage

    Complete your mastery of R6 by learning about advanced topics such as copying by reference, shared fields, cloning objects, and finalizing objects. The chapter concludes with an interview with Winston Chang, creator of the R6 package.

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

Richie Cotton
Richie Cotton

Head of Content Quality at DataCamp

Richie runs the Content Quality team at DataCamp. He has been using R since 2004, in the fields of proteomics, debt collection, and chemical health and safety. He has released almost 30 R packages on CRAN and Bioconductor – most famously the assertive suite of packages – as well as creating and contributing to many others. He also has written two books on R programming, Learning R and Testing R Code.

See More
Icon Icon Icon professional info