R에서 S3와 R6로 배우는 Object-Oriented Programming
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로 배우는 Object-Oriented Programming