SpatioTemporal (version 1.1.9.1)

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.raw.

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

coords

The x,y-coordinates for monitors

coords.beta,coords.nu

Alternative x,y-coordinates for monitors, used when computing distance-matrices for the beta- and nu-fields. Allows the use of non-stationary covariance structures thourgh the deformation method of Damian (2003), given a precomputed deformation.

long.lat

The long,lat-coordinates for monitors

others

Additional fields in STdata$covars that should be added to the location data.frame

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, estimateBetaFields, loglikeSTdim, loglikeST, predictNaive, processLUR, updateCovf, updateTrend.STdata

Examples

Run this code
# NOT RUN {
##load the data
data(mesa.data.raw)
##and create STdata-object
mesa.data <- createSTdata(mesa.data.raw$obs, mesa.data.raw$X, n.basis=2,
                          SpatioTemporal=mesa.data.raw["lax.conc.1500"])

##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 DataCamp Workspace