Learn R Programming

OasisR (version 3.1.0)

spatmultiseg: A function from seg package to compute spatial multi-group segregation indices

Description

A function adapted from seg package (Hong et al. 2014) to compute spatial multi-group segregation indices developed by Reardon and O'Sullivan (2004)

Usage

spatmultiseg(x, spatobj = NULL, folder = NULL, shape = NULL, ...)

Value

A vector with Reardon's spatial multi-group segregation indices: D* - spatial multi-group dissimilarity index R* - spatial multi-group relative diversity index H* - spatial multi-group information theory index

Arguments

x

- an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group.

spatobj

- a spatial object (SpatialPolygonsDataFrame) with geographic information

folder

- a character vector with the folder (directory) name indicating where the shapefile is located on the drive

shape

- a character vector with the name of the shapefile (without the .shp extension) .

...

- other parameters of spseg function from seg package.

References

Reardon, S. F. and O'Sullivan, D. (2004) Measures of spatial segregation. Sociological Methodology, 34, 121-162.

Hong S.Y., O'Sullivan D., Sadahiro Y. (2014) Implementing Spatial Segregation Measures in R'. PLoS ONE, 9(11)

See Also

Multi-group indices: PMulti, GiniMulti, DMulti, HMulti, RelDivers

Social diversity indices: HShannon, NShannon, ISimpson,

Examples

Run this code
x <- segdata@data[ ,1:2]
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'segdata'

spatmultiseg(x, spatobj = segdata)

spatmultiseg(x, folder = foldername, shape = shapename) 

Run the code above in your browser using DataLab