I need to get the name of the R6 class variable from inside the class. Can I do that? - like in example below:
Simple <- R6Class( "Simple",
public = list(
myname = NA,
dt = NA,
initialize = function () {
self$myname = substitute(self)
}
)
)
mysimple <- Simple$new()
mysimple$myname
This returns self
.
And i want this to return mysimple
.
This would be useful for storing a class variable with saveRDS()
and then restoring it with saveRDS()