Learn R Programming

OasisR (version 1.0.0)

boundaries: A function to compute the matrix of common boundaries

Description

The function is based on rgdal and rgeos packages and it can be used by providing a shape file or a R spatial object (SpatialPolygonsDataFrame).

Usage

boundaries(spatobj = NULL, folder = NULL, shape = NULL)

Arguments

spatobj
- a Spatial object (SpatialPolygonsDataFrame)
folder
- a character vector with the folder (directory) where the shapefile is
shape
- a character vector with the name of the shapefile (without the .shp extension)

Value

  • A matrix with common boundaries between spatial units

See Also

Other spatial functions used for segregation indices computation: area, contig, perimeter, distance, distcenter, xgeo

Examples

Run this code
boundaries(AnnHAge)

foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'AnnHAge'
boundaries(folder = foldername, shape = shapename)

Run the code above in your browser using DataLab