GitHub
LinkedIn
Twitter
YouTube
RSS

Object Oriented Programming in R

Object Oriented Programming in R

Course Level: Advanced

The training course will cover R object-oriented programming techniques. We’ll discuss what OOP is and the different varieties within R. Beginning with the popular S3 and S4 OOP frameworks, we’ll finish with the new {R6} package that is used extensively in Shiny applications. By the end of the course, participants will be able to use OOP within their own code.

Book: Object Oriented Programming in R

Start Date:
Price:
Venue Details:
Time:
Duration:

Course Details

  • Course Outline
  • Learning Outcomes
  • Materials
  • Prior Knowledge

Course Outline

  • Advanced Functions:

    • Scoping rules (including lexical scope)
    • The … argument
    • Argument matching
  • S3 classes:

    • Introduction to object-oriented programming
    • Constructing S3 objects
    • Drawbacks
  • S4 classes:

    • Creating and using S4 classes
    • Differences between S3 and S4 classes
  • R6 classes

    • Differences between {R6} and S3/S4
    • Mutable states
    • Creating methods
    • Shallow and deep copies

Learning Outcomes

By the end of the course, participants will be able to…

  • Select the most appropriate form of OOP for their task
  • Leverage encapsulation, polymorphism and inheritance to provide a nice user interface to their code
  • Write functions with rich results, user-friendly display and programmer-friendly internals
  • Extend the functionality of functions for new object types
  • Write code that is extensible by others

Materials

  • Page 1 of example course material for Object Oriented Programming in R
  • Page 2 of example course material for Object Oriented Programming in R
  • Page 3 of example course material for Object Oriented Programming in R
  • Page 4 of example course material for Object Oriented Programming in R
  • Page 5 of example course material for Object Oriented Programming in R

Prior Knowledge

This course assumes that participants are comfortable with the fundamentals of R programming, writing functions and control flow. It follows on from the Programming with R course.

Attendee Feedback