processLocation: Internal Function that Extracts Locations

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

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

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

Value

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

Author(s)

Johan Lindstrom

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
##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) )

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