base_class | R Documentation |
R6 class for providing additional default R6 class features
a base_class
class (R6 class)
new()
base_class$new(argList = NULL, ...)
argList
A 'List' of name/value pairs to be passed in as arguments.
...
Name/Value pairs as arguments.
none Nothing is returned
Dump object values
Convenient for debugging private class values (puts var named tmpVar in global environment)
dump()
base_class$dump()
private The private environment of the object
obj = some_R6_class$new() obj$dump() data = tmpVar$some_private_var_name data = tmpVar[["some_private_var_name"]] Get variable Gets a private variables value.
get_var()
base_class$get_var(var_name)
var_name
The name of the private variable to return.
var The value of the requested variable.
obj = some_R6_class$new() var_value = obj$get_var("var_name") Set variable Sets a private variables value. This method is chainable.
set_var()
base_class$set_var(var_name, var_value)
var_name
The name of the private variable to set.
var_value
The value to assign to the desired private variable.
object_ref The reference to the original object.
obj = some_R6_class$new() obj$set_var("var_name", var_value)
clone()
The objects of this class are cloneable with this method.
base_class$clone(deep = FALSE)
deep
Whether to make a deep clone.
new_class = R6::R6Class(
"new_class",
inherit = base_class,
portable = TRUE,
public = list(
...
),
private = list(
...
)
)
Initialize object
Allow list based function initialization (easier to integrate with config files)
## ------------------------------------------------
## Method `base_class$dump`
## ------------------------------------------------
obj = some_R6_class$new()
obj$dump()
data = tmpVar$some_private_var_name
data = tmpVar[["some_private_var_name"]]
Get variable
Gets a private variables value.
## ------------------------------------------------
## Method `base_class$get_var`
## ------------------------------------------------
obj = some_R6_class$new()
var_value = obj$get_var("var_name")
Set variable
Sets a private variables value.
This method is chainable.
## ------------------------------------------------
## Method `base_class$set_var`
## ------------------------------------------------
obj = some_R6_class$new()
obj$set_var("var_name", var_value)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.