createInstance-character-missing-method: Create Class Instance

Description Usage Arguments Value Author(s) References See Also Examples

Description

See generic: createInstance

Usage

1
2
3
## S4 method for signature 'character,missing'
createInstance(cl, input = new.env(parent =
  emptyenv()), strict = FALSE, ...)

Arguments

cl

character.

input

missing.

strict

logical. TRUE: error if cl is not a class (checked by isClass); FALSE: no class existence check.

...

Further arguments to be passed to subsequent functions/methods.

Value

See method createInstance-character-ANY.

Author(s)

Janko Thyson janko.thyson@rappster.de

References

http://github.com/rappster/classr

See Also

createInstance

Examples

 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))

rappster/classr documentation built on May 26, 2019, 11:11 p.m.