powered by
Test if an object belongs to given class(es), and produce reasonable error message if not.
stCheckClass(x, what, name = "Object")
Object to test.
A character vector naming classes.
Character string to be pasted into the error message describing x.
x
Nothing
Similar to inherits
inherits
Other object checking utilities: stCheckCovars, stCheckFields, stCheckObs, stCheckSTcovars
stCheckCovars
stCheckFields
stCheckObs
stCheckSTcovars
# NOT RUN { ##create a basic object x <- 1 class(x) <- "test" ## should be ok stCheckClass(x, "test", "x") ## this fails try( stCheckClass(x, "other", "x") ) # }
Run the code above in your browser using DataLab