Chapter 15 Object-Oriented Programming in R

repeat {



    if ( coffeeMug$empty() ) {

        if ( coffeePot$empty() ) {





    if ( workTask$done() ) {




Our journey with R began in the Procedural Programming paradigm. In the last Chapter we learned about R’s extensive support for the more modern paradigm known as Functional Programming. In the present Chapter we will explore the ways in which R supports a third modern programming paradigm: Object-Oriented Programming.