9.4 Object Orientation in R

Object-orietned programming (OOP) is a programming paradigm that encapsulates related code and data into conceptual “objects.” These objects generally are used to organize code and make it easier to write by passing these encapsulated data and code together as a unit. There are several different styles of OOP, and a programming language my implement more than one style, or none at all.

Although R is primarily a functional programming language it does support OOP in several different ways. Hadley Wickham has written an excellent book chapter on OOP in R and thus is not replicated here.