R における S3 と R6 を使ったオブジェクト指向プログラミング
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 リストに格納new() でオブジェクト作成R における S3 と R6 を使ったオブジェクト指向プログラミング