spatmultiseg | R Documentation |
A function adapted from seg package (Hong et al. 2014) to compute spatial multi-group segregation indices developed by Reardon and O'Sullivan (2004)
spatmultiseg(x, spatobj = NULL, folder = NULL, shape = NULL, ...)
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. |
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
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)
Multi-group indices:
PMulti
, GiniMulti
, DMulti
,
HMulti
, RelDivers
Social diversity indices:
HShannon
, NShannon
,
ISimpson
,
x <- segdata@data[ ,1:2]
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'segdata'
spatmultiseg(x, spatobj = segdata)
spatmultiseg(x, folder = foldername, shape = shapename)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.