spatinteract: A function adapted from seg package to compute spatial...

Description Usage Arguments Value References See Also Examples

View source: R/SegFunctions.R

Description

A function adapted from seg package (Hong et al. 2014) to compute spatial exposure/isolation indices developed by Reardon and O'Sullivan (2004)

Usage

1
spatinteract(x, spatobj = NULL, folder = NULL, shape = NULL, ...)

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.

Value

A matrix with Reardon's spatial exposure/isolation indices

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

1
2
3
4
5
6
7
x <- segdata@data[ ,1:2]
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'segdata'

spatinteract(x, spatobj = segdata)

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

OasisR documentation built on July 2, 2020, 3:14 a.m.

Related to spatinteract in OasisR...