stCheckObs {SpatioTemporal} | R Documentation

## Check an `obs` data.frame.

### Description

Checks that a observation data.frame is valid.

### Usage

    stCheckObs(obs)

### Arguments

`obs` | `data.frame` to be checked.

### Details

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`)

### Value

Nothing

### Author(s)

Johan Lindstrom

### See Also

Other object checking utilities: `stCheckClass`, `stCheckCovars`, `stCheckFields`, `stCheckSTcovars`

### Examples

      ##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 ) )

[Package SpatioTemporal version 1.1.9.1 Index]