border_from_grid_points: Extract border

Description Usage Arguments Details Value Author(s) Examples

View source: R/geometryfns.R

Description

The border is extracted from shapes supplied in x-y format

Usage

1

Arguments

df

a data frame with fields x and y.

delta

the grid spacing.

Details

The algorithm works by finding how many neighbours a grid point has using fields::fields.rdist.near. A grid point with less than 4 neighbours is assumed to be a border point. For this algorithm to work, it is important that the shape is ‘full’ and not contain any missing values.

Value

a subset of df containing the border points.

Author(s)

Andrew Zammit Mangion

Examples

1
2
3
grid <- expand.grid(x = c(1:10), y = c(1:10))
names(grid) = c("x","y")
border_points <- border_from_grid_points(df=grid,delta=1)

shazhe/mvst0 documentation built on May 29, 2019, 9:20 p.m.