The R6 package provides a type of class which is similar to R’s standard reference classes, but it is more efficient and doesn’t depend on S4 classes and the methods package
Questions tagged [r6]
181 questions
-5
votes
1 answer
How can I prevent R6 classes to access non-existent members?
R6 automatically sets to NULL anything I access on self
> x <- R6::R6Class("x", list(foo = function() { print(self$notexistent) }))
> xx <- x$new()
> xx$foo()
NULL
This means that if I make a typo in one access e.g. results instead of result it…

Stefano Borini
- 138,652
- 96
- 297
- 431