Is there any way to use a private value in order to create another private value inside R6Class()
? I am getting errors.
obj <- R6Class(
"abc",
private = list(
a = 2,
b = 2*private$a
)
)
Error in all_named(private) : object 'private' not found
I have also tried to create b
with b = 2 * a
, but it is still impossible. How should I go about it?
Thank you
obj <- R6Class(
"abc",
private = list(
a = 2,
b = function() 2*self$a
)
)