Learn R Programming

SpatioTemporal (version 0.9.2)

default.LUR.list: Error Checking and Default Values for Covariate Selection

Description

Functions that compare the covariates requested (both geographic and spatio-temporal) with those available in mesa.data and modifies the covariate request to ensure that only available covariates are used.

Usage

default.LUR.list(mesa.data, LUR = NA)

default.ST.list(mesa.data, ST.Ind = NA)

Arguments

mesa.data
Data structure holding observations, observation locations, smooth temporal trends, geographic covariates and spatio-temporal covariates. See mesa.data.
LUR
A vector or list of vectors indicating which geographic covariates to use.

If LUR = NA all covariates are used for all the temporal trends. If a vector of integers or characters (names) is used to specify covariates, these co

ST.Ind
A vector of integers or characters (names) indicating which of the spatio-temporal covariates in mesa.data to include. ST.Ind = NA will include all covariates, ST.Ind = NUL

Value

  • Returns either a LUR-list or ST.Ind-vector that refers to the covariate elements of mesa.data by name, ensuring that all elements referred to actually exist in mesa.data.

encoding

latin1

See Also

Used internally by: create.data.model, construct.LUR.basis, and construct.ST.basis. See also mesa.data and create.data.model.

For other data functions, see mesa.data.raw, mesa.data.model and create.data.matrix.

Examples

Run this code
##load the data
data(mesa.data)

##create a simple set of covariates
default.LUR.list(mesa.data, list(c(1:3),1,2))

##or a structure with the same covariates for all
##temporal trends
default.LUR.list(mesa.data, c(1,2))

##or a structure with only intercept for the temporal trends
default.LUR.list(mesa.data, list(c(1:3),NULL,NULL))

##Ask for covariates by name
default.LUR.list(mesa.data, list(c("log10.m.to.a1","log10.m.to.a2"),
                                 "log10.m.to.a1","log10.m.to.a1"))

##Ask for non-existent covariate by name (produces three warnings, one
##for each temporal trend)
default.LUR.list(mesa.data, "log10.m.to.a4")

##create a simple set of spatio-temporal covariates
default.ST.list(mesa.data, 1)

##or create a empty set of spatio-temporal covariates
default.ST.list(mesa.data, NULL)

Run the code above in your browser using DataLab