R6
R6 copied to clipboard
Encapsulated object-oriented programming for R
When defining an R6 object within a package, running 'Check' will cause 'self' to trigger 'no visible binding for global variable' message. One way to fix it is: ``` if(getRversion()...
I would like a controlled way to add methods/fields to instantiated objects. For example, have a class producing locked objects which cannot be extended _except_ for a qualified decorator. A...
A large-ish matrix is a part of an R6 object as a public or private field, and a update_matrix method allows updating a certain cell of the matrix. However, this...
So these would be equivalent: ```r R6::R6Class("class", public = list( x = I(my_function) ) ) R6::R6Class("class", public = list( initialize = function() self$x = my_function, x = NULL ) )...
In this example, there are two references to `.__active__`, but there should only be one. ```R library(R6) A print.bytes Rcpp rls(b$getx) #> [[1]] #> [1] ".__active__" #> #> [[2]] #>...
Edited for simplicity with the root issue. Here I create a R6 class (generator) and an object instance. Then call `structure(...)` on that instance, which apparently modifies the original object...
R-devel has changed their handling of `as.list.environment()` regarding active bindings. Instead of turning the ABs into functions, it now gives the *values* that the ABs would have had, had they...
``` public = list( blah = active_binding(function(value) { }) ) ``` And eventually deprecate the `active_bindings` argument
I'm wondering if it would be possible to add an option to compile object methods with R's byte compiler during object init? I have a case when object methods are...