Learn R Programming

RCALI (version 0.3.7)

generVois: Generate the neighbors of each polygon of a regular grid

Description

For each polygon of a regular grid, generate the indexes of its neighbour polygons

Usage

generVois(np = 10, nvois = 1)

Value

A two-columns matrix, of all pairs of neighbourgs.

Arguments

np

Number of polygons on each axis of the grid.

nvois

Number of polygons required in the neighbourhood, on each direction, for each polygon

Details

For each polygon P of a regular grid made of np polygons along each axis, the indexes of its neighbours are generated: the neighbours are the polygons included in the square made of nvois polygons below, above, at the right and left sides of P, in the limit of the grid bounds.

See Also

generPoly, califlopp

Examples

Run this code
generVois(np=3)

Run the code above in your browser using DataLab