The R6 Class System

Sign in to queue

Description

useR!2017: The R6 Class System

Keywords: Classes, Object-oriented programming, R6, Reference classes
Webpages: https://CRAN.R-project.org/package=R6, https://github.com/wch/R6
R6 is an implementation of a classical object-oriented programming system for R. In classical OOP, objects have mutable state and they contain methods to modify and access internal state. This stands in contrast with the functional style of object-oriented programming provided by the S3 and S4 class systems, where the objects are (typically) not mutable, and the methods to modify and access their contents are external to the objects themselves.
R6 has some similarities with R's built-in Reference Class system. Although the implementation of R6 is simpler and lighter weight than that of Reference Classes, it offers some additional features such as private members and robust cross-package inheritance.
In this talk I will discuss when it makes sense to use R6 as opposed to functional OOP, demonstrate how to use the package, and explore some of the internal design of R6.

Day:

1

Embed

Download

Download this episode

The Discussion

Add Your 2 Cents