stCheckSTcovars: Check an Array/List of Spatio-Temporal Covariates

Description Usage Arguments Value Author(s) See Also Examples

Description

Checks that array/list of spatio-temporal covariates is valid, making sure that at least all locations specified in ID.unique exist. The function will attempt to name extract locations ID's from colnames(ST) and observation dates from rownames(ST) (using convertCharToDate).

Usage

1
stCheckSTcovars(ST, ID.unique = character(0), date.unique = integer(0))

Arguments

ST

A 3D-array containing the ST-covariates, or a list of array:s, the list elements have to be of matching sizes and have the same rownames and colnames; list elemets are stacked to form a 3D-array.

ID.unique

vector with unique IDs that HAVE to be present in the ST-covariates, typically the observation locations and un-observation locations for predictions

date.unique

vector with unique dates/times that HAVE to be present in the ST-covariates, typically the observation time-points.

Value

Updated ST array

Author(s)

Johan Lindstrom

See Also

Other object checking utilities: stCheckClass, stCheckCovars, stCheckFields, stCheckObs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  ##load data
  data(mesa.model)

  ##check covariates
  tmp <- stCheckSTcovars( mesa.model$ST.all, mesa.model$locations$ID )
  str(tmp)
  ##require non-existant site
  try( stCheckSTcovars( mesa.model$ST.all, "Bad.Site" ) )
  ##require non-existant site
  try( stCheckSTcovars( mesa.model$ST.all, date.unique=1 ) )

SpatioTemporal documentation built on May 2, 2019, 8:49 a.m.