border.grid: Construct border for grid

Description Usage Arguments Details Value Author(s) Examples

View source: R/border.grid.R

Description

border.grid determines the border for data on a grid. x and y must define a regular or irregular grid. See Details.

Usage

1
2
3
4
5
6
7
border.grid(x, y, proj4string)

border_grid(x, y, proj4string)

borderGrid(x, y, proj4string)

BorderGrid(x, y, proj4string)

Arguments

x

A vector or matrix of x coordinates. See Details.

y

A vector or matrix of y coordinates. See Details.

proj4string

A projection string of class CRS-class. If not provided, then default values are used. This should be changed with caution.

Details

A regular grid is defined by ascending numeric vectors x and y. A vector x is ascending if x[i] < x[j] for i < j.

An irregular grid is defind by ascending matrices. A matrix x is ascending if x[i, j] < x[i, l] for j < l and if x[i, j] < x[k, j] and j < k.

Value

A SpatialPolygons object.

Author(s)

Joshua French

Examples

1
2
3
4
5
6
7
8
9
# create x and y defining square border
x = seq(min(lon), max(lon), length = 60)
y = seq(min(lat), max(lat), length = 80)
border = border.grid(x, y)
sp::plot(border)

# use lon and lat to define border of an irregular grid
border2 = border.grid(lon, lat)
sp::plot(border2)

hero documentation built on Jan. 25, 2020, 1:07 a.m.