Learn R Programming

OasisR (version 1.0.0)

xgeo: A function to compute all spatial info for segregation indexes

Description

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

Usage

xgeo(spatobj = NULL, folder = NULL, shape = NULL, center = 1)

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)
center
- the row number of the center

Value

  • A list that contains all geographic information needed to calculate segregation indexes.

See Also

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

Examples

Run this code
xgeo(AnnHAge, center = 1)

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

Run the code above in your browser using DataLab