Description Usage Arguments Value Author(s) See Also Examples
Test if named fields exist in name(x)
, if not the function
fails with a suitable error message.
1 | stCheckFields(x, what, name = "Object")
|
x |
Object to test. |
what |
A character vector naming that should occur in |
name |
Character string to be pasted into the error message describing
|
Nothing
Johan Lindstrom
Other object checking utilities: stCheckClass
,
stCheckCovars
, stCheckObs
,
stCheckSTcovars
1 2 3 4 5 6 7 8 9 | ##load data
data(mesa.model)
##names present in dta
names(mesa.model$locations)
##check for some names
stCheckFields(mesa.model$locations, c("ID","x","lat"))
##check for non-existant names
try( stCheckFields(mesa.model$locations, c("ID","x","test")) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.