Description Usage Arguments Details Value Author(s) See Also Examples
Checks that a observation data.frame is valid.
1 | stCheckObs(obs)
|
obs |
|
A valid observation data.frame needs to fullfill:
Contains fields obs
, date
, and ID
All elements in obs$obs
are finte
obs$date
is one of Date
, numeric
,
or integer
obs$ID
is character
No duplicated observations (same ID
and date
)
Nothing
Johan Lindstrom
Other object checking utilities: stCheckClass
,
stCheckCovars
, stCheckFields
,
stCheckSTcovars
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##load data
data(mesa.model)
##check observations
stCheckObs( mesa.model$obs )
##some possible failures
mesa.model$obs <- rbind(mesa.model$obs, mesa.model$obs[1,])
try( stCheckObs( mesa.model$obs ) )
mesa.model$obs$obs[1] <- NaN
try( stCheckObs( mesa.model$obs ) )
mesa.model$obs$date <- as.character( mesa.model$obs$date )
try( stCheckObs( mesa.model$obs ) )
mesa.model$obs$date <- NULL
try( stCheckObs( mesa.model$obs ) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.