stCheckObs {SpatioTemporal} | R Documentation |
obs
data.frame.Checks that a observation data.frame is valid.
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
##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 ) )