Create a Data Frame of Cell Boundaries From Vectors of Coordinates

Description

A function to create a data frame of cell boundary values from vectors of x and y coordinates. This function is commonly used to create inputs suitable for entry into the LatticeTransitionProbs function.

Usage

1

Arguments

x

A double vector denoting the locations of cell boundaries of a lattice on the x-axis. range(x) defines the total extent of the lattice on the x-axis.

y

A double vector denoting the locations of cell boundaries of a lattice on the y-axis. range(y) defines the total extent of the lattice on the y-axis.

Value

A data frame with (length(x.coords) - 1) * (length(y.coords) - 1) rows containing the boundary coordinates for each cell in the lattice:

x1

Lower x-coordinate of each cell in the lattice

x2

Upper x-coordinate of each cell in the lattice

y1

Lower y-coordinate of each cell in the lattice

y2

Upper y-coordinate of each cell in the lattice

Author(s)

Joseph Chipperfield <joechip90@googlemail.com>

See Also

LatticeTransitionProbs

Examples

1
2
3
4
5
# Create a data frame of cell boundary coordinates of cell of a 5x5
# lattice with regular cell length of one unit
x.coords <- seq(0.0, 5.0, 1.0)
y.coords <- seq(0.0, 5.0, 1.0)
MakeGridFromCoords(x.coords, y.coords)