Learn R Programming

SpatioTemporal (version 1.1.2)

processLocation: Internal Function that Extracts Locations

Description

Function that creates a data.frame of locations (and auxillirary information) from STdata$covars, used by createSTmodel.

Usage

processLocation(STdata, locations)

Arguments

STdata
STdata object with observations, covariates, trends, etc; see mesa.data.
locations
A list specifying which fields in STdata$covars that should be used for what in the location data.frame, see details.

Value

  • A data.frame with location information for all the sites.

Details

The locations list specifies what should go in the locations data.frame, in addition to thing listed below STdata$covars$ID is always added. Each of the fields below should contain names (as character) of columns in STdata$covars [object Object],[object Object],[object Object],[object Object]

References

D. Damian, P. D. Sampson, P. Guttorp. (2003) Variance modeling for nonstationary processes with temporal replications. J. Geophys. Res.: D24(108)

See Also

Other STmodel functions: createCV, createDataMatrix, createSTmodel, dropObservations, loglikeST, loglikeSTdim, loglikeSTnaive, predictNaive, processLUR, processST, updateCovf

Examples

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

##specify locations, using x/y and specifying long/lat and picking
##type as an additional field
loc.spec <- list(coords=c("x","y"), long.lat=c("long","lat"), others="type")
##create the location data.frame
str( processLocation(mesa.data, loc.spec) )

##specify only locations
str( processLocation(mesa.data, list(coords=c("x","y"))) )

##different coordinates for beta and nu fields
loc.spec <- list(coords=c("x","y"), coords.nu=c("long","lat"))
str( processLocation(mesa.data, loc.spec) )

Run the code above in your browser using DataLab