map.obs.to.grid: Maps non-gridded data to a grid.

Description Usage Arguments Value Author(s) Examples

Description

Maps non-gridded data to a grid based on the coordinates supplied. Cells with no data are NA. For cells with more than one data point, the average is taken.

Usage

1
map.obs.to.grid(n,y.non.grid,coord,lengthx=NULL,lengthy=NULL)

Arguments

y.non.grid

Observed data in an T x N matrix with columns and rows corresponding to time and space, respectively. The coordinates of each observation point need to be specified in 'coord'.

coord

Matrix of dimension N x 2 with coordinates of the N observation points. Based on to these coordinates, each observation location is then mapped to a grid cell.

lengthx

Use together with 'coord' to specify the length of the x-axis. This is usefull if the observations lie in a rectangular area instead of a square. The length needs to be at least as large as the largest x-distance in 'coord.

lengthy

Use together with 'coord' to specify the length of the y-axis. This is usefull if the observations lie in a rectangular area instead of a square. The length needs to be at least as large as the largest y-distance in 'coord.

n

Number of point per axis of the square into which the points are mapped. In total, the process is modeled on a grid of size n*n.

Value

The function returns data in an T x n^2 matrix with columns and rows corresponding to time and space, respectively. Cells with no data are NA. For cells with more than one data point, the average is taken.

Author(s)

Fabio Sigrist

Examples

1
## See code of 'spate.mcmc'.


Search within the spate package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.