Chapter 15 Object-Oriented Programming in R

repeat {

    coffeeMug$drinkFrom()

    workTask$execute()

    if ( coffeeMug$empty() ) {

        if ( coffeePot$empty() ) {

            coffeePot$make()

        }

        coffeeMug$fill()

    }

    if ( workTask$done() ) {

        break

    }

}

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.