I have created a setRefClass
, I would like to know how you can implement the accessors so that when you create a new instance of this class you can access the fields by using setXXX
, getXXX
.
I was thinking of using .self$accessors(names(.self$fields()))
in initialize method but it doesn`t seem to work.
pathRoot <- setRefClass(
Class = "pathRoot",
fields = list(
# basic info of path
W = "character",
Y = "character",
H = "character"
),
)