leanify_r6 | R Documentation |
leanify_r6
moves the content of an R6::R6Class
's functions to an environment,
usually the package's namespace, to save space during serialization of R6 objects.
leanify_package
move all methods of all R6 Classes to an environment.
The function in the class (i.e. the object generator) is replaced by a stump function that does nothing except calling the original function that now resides somewhere else.
It is possible to call this function after the definition of an R6::R6
class inside a package, but it is preferred to use leanify_package()
to just leanify all R6::R6 classes inside a package.
leanify_r6(cls, env = cls$parent_env)
leanify_package(pkg_env = parent.frame(), skip_if = function(x) FALSE)
cls |
(R6::R6Class) |
env |
( |
pkg_env |
:: |
skip_if |
:: |
NULL
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.