identify_n_neighbours: Find A Polygon's Neighbour Polygons

Description Usage Arguments Value Examples

View source: R/PWN_functions.R

Description

Identify for each element in a SpatialPolygons object, its n closest neighbours.

Usage

1
2
identify_n_neighbours(Spat.polygons, n, append = F,
  col.prefix = "IDneighb_")

Arguments

Spat.polygons

A SpatialPolygons(DataFrame)

n

The nr of neighbouring polygons to detect

append

Should the output be appended to the data in the SpatialPolygonsDatafrmae

col.prefix

A prefix to use in the output of the columns that include hold the IDs of the neighbours

Value

a SpatialPolygonsDataframe with a column with unique IDs and n columns holding the IDs of the n closest neighbours

Examples

1
2
3
4
5
## Not run: 
Decline.cluster <- shapefile('E:/beckpie/PWN/vector_data/Decline_N_tree_clusters.shp')
tt <- identify_n_neighbours(Spat.polygons = Decline.cluster,n=2,append=T)

## End(Not run)

pieterbeck/CanHeMonR documentation built on May 25, 2019, 7:11 a.m.