Description Usage Arguments Details Value Examples
Gets the name of the given R6 object
1 | getR6Class(object, classname = TRUE, n.par = 0, pos = -1)
|
object |
R6 object. |
classname |
logical, if TRUE (default), returns the name of the class otherwise returns the class. |
n.par |
numeric, which class should be returned? By default returns the class of the object, increasing the number returns parents of the class (if applicable). |
pos |
environment to search in, default is -1 (current) |
The function works for R6 objects not classes. If the function fails make sure the class is first constructed. This is a wrapper for class(object) when the object may have multiple levels of inheritance, additionally it ensures the correct classname is used in case of a complex naming scheme.
string giving R6 class name.
1 2 3 4 5 6 7 8 9 10 | parent <- R6::R6Class("parent")
child <- R6::R6Class("child",inherit = parent)
getR6Class(child$new(), n.par = 0)
getR6Class(child$new(), n.par = 1)
getR6Class(parent$new(), FALSE, n.par = 0)
## Not run:
getR6Class(parent$new(), parent = 1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.