Object-Oriented Programming with S3 and R6 in R
Richie Cotton
Data Evangelist at DataCamp




library(R6) thing_factory <- R6Class( "Thing",private = list( a_field = "a value", another_field = 123 ))
a_thing <- thing_factory$new()
another_thing <- thing_factory$new()
yet_another_thing <- thing_factory$new()
R6Class()private listnew() methodObject-Oriented Programming with S3 and R6 in R