grid_points: Creates a regular grid of points around a...

Description Usage Arguments Value Author(s) Examples

View source: R/grid_points.r

Description

This function takes as input a set of geographic points, as a SpatialPointsDataFrame. For each point in the input object, it genereates a regular grid of points surrounding it, of chosen dimensions. This is useful for setting up an array of repeat sampling locations, for example, for assessing vegetation condition or canopy cover, for a sequence of geographic locations.

Usage

1
grid_points(points, spacing = 25, gridsize = 3)

Arguments

points

A SpatialPointsDataFrame object, which can be loaded from a shapefile using the readShapePoints command of the package.

spacing

The spacing between lines of the grid. The default is 25. This value is expressed in the same coordinate system as the input spatial data, so be aware that for data in geographic (latitude/longitude) projections, this value represents degrees.

gridsize

The number of rows/columns in the grid, for example, the default value of 3 will produce a 3x3 grid of nine points surrounding the centre point.

Value

A SpatialPointsDataFrame object containing the grid of points.

Author(s)

Grant Williamson

Examples

1
2
3
4
data(SplashDams)
plot(SplashDams)
gridded = grid_points(SplashDams,0.03,3)
plot(gridded)

ozjimbob/ecbtools documentation built on Jan. 18, 2021, 7:39 p.m.