Description Usage Arguments Value Author(s) See Also Examples
Test if an object belongs to given class(es), and produce reasonable error message if not.
1 | stCheckClass(x, what, name = "Object")
|
x |
Object to test. |
what |
A character vector naming classes. |
name |
Character string to be pasted into the error message describing
|
Nothing
Johan Lindstrom
Similar to inherits
Other object checking utilities: stCheckCovars
,
stCheckFields
, stCheckObs
,
stCheckSTcovars
1 2 3 4 5 6 7 | ##create a basic object
x <- 1
class(x) <- "test"
## should be ok
stCheckClass(x, "test", "x")
## this fails
try( stCheckClass(x, "other", "x") )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.