ensureClassRegistration: Ensure Class Registration

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

Description

Ensures that classes are registrated in a sense that they are recognized by isClass.

Usage

1

Arguments

cl

Signature argument. Object containing class information. This usually corresponds to the name of a class.

strict

logical. TRUE: error if cl is already a class (checked by isClass); FALSE: if class already exists it is not reset.

...

Further arguments passed to subsequent functions/methods. In particular: setOldClass

Details

Esentially, this functions simply calls setOldClass in order to register the classes. A call to this method might make sense inside .onLoad and .onAttach of your packages.

Author(s)

Janko Thyson janko.thyson@rappster.de

References

http://github.com/rappster/classr

See Also

ensureClassRegistration-missing-method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

## NOTE //
## Keeping the default for 'where'  that is used by 'setOldClass',
## i.e. simply *not* providing a value in the call to 'ensureClassRegistration',
## only works as long as your package has not been fully loaded yet
ensureClassRegistration(cl = "TestClass")
isClass("TestClass")
ensureClassRegistration(cl = "TestClass")
try(ensureClassRegistration(cl = "TestClass", strict = TRUE))
ensureClassRegistration(cl = c("TestClass1", "TestClass2"))
isClass("TestClass1")
isClass("TestClass2")


## End(Not run)

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