Learn R Programming

OasisR (version 1.0.0)

Wong: A function to compute Wong's segregation index

Description

Wong's segregation index develops Duncan's index by taking into account the interaction between spatial units (common boundaries and perimeters). The function can be used in two ways: by providing the boundaries matrix and perimeter vector or a geographic source (spatial object or shape file) wich will be used to compute the geographic information within the function

Usage

Wong(x, b = NULL, p = NULL, a = NULL,  spatobj = NULL, folder = NULL, shape = NULL)

Arguments

x
- an object of class matrix (or that can be coerced to that class), where each column represents the distribution of a population group, within spatial units. The number of columns should be greater than one (at least two population groups are require
b
- a common boundaries matrix where each element Bij equals the shared boundary of i-th and j-th spatial units.
p
- a vector with the perimeters of spatial units
a
- a vector with areas of spatial units
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 vector with Wong segregation index

References

Wong D. W. S. (1998) Measuring multiethnic spatial segregation. Urban Geography, 19 (1), pp. 77-87.

See Also

Other evenness intragroup indices: Duncan, Morill, Gini, Gorard Intergroup dissimilarity index: DI

Examples

Run this code
x <- slot(AnnHAge, 'data')[ ,3:5]
bound <- boundaries(AnnHAge)
per <- perimeter(AnnHAge)
ar <- area(AnnHAge)
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'AnnHAge'

Wong(x, b = bound, p = per, a = ar)

Wong(x, spatobj = AnnHAge)

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

Run the code above in your browser using DataLab