Description Usage Arguments Value Author(s) References See Also Examples
See generic: createInstance
1 2 3 | ## S4 method for signature 'character,ANY'
createInstance(cl, input = new.env(parent =
emptyenv()), strict = FALSE, ...)
|
cl |
|
input |
Signature argument. Object containing object information that is relevant in the context of instantiating. This usually corresponds to an object that should be used "as is" as the actual instance object and for which only the class path should be updated. |
strict |
|
... |
Further arguments to be passed to subsequent functions/methods. |
cl |
|
ANY
. Either input
with modified class path or
an object that is actually an empty environment
but has an
updated class path with class cl
being the first element.
Janko Thyson janko.thyson@rappster.de
http://github.com/rappster/classr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ##------------------------------------------------------------------------------
## Default instance "body" //
##------------------------------------------------------------------------------
res <- createInstance("TestClass")
res
ls(res)
class(res)
##------------------------------------------------------------------------------
## Explicit object as instance "body" //
##------------------------------------------------------------------------------
res <- createInstance("TestClass",
input = list(x = TRUE, y = list(x_1 = 1, x_2 = 2)))
res
## Strict //
try(createInstance("TestClass", strict = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.