Learn R Programming

OasisR (version 1.0.0)

SP: A function to compute the proximity index (SP)

Description

The index compares the clustering level of a group to another. The function can be used in two ways: by providing a distance matrix or a geographic source (spatial object or shape file) wich will be used to compute the matrix within the function

Usage

SP(x, d = NULL, fdist = 'l', 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
d
- a matrix with the distances between spatial units centroids
fdist
- the method used for distance calculations: 'l' for linear (by default) and 'e' for exponential function.
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 matrix with SP values

References

White M. J. (1988) The Measurement of Spatial Segregation. American Journal of Sociology, 88, p. 1008-1019

See Also

Absolute Clustering Index: ACL Other proximity measures: Pxx, Pxy, Poo

Examples

Run this code
x <- slot(GreHSize, 'data')[ ,3:5]
dist <- distance(GreHSize)
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'GreHSize'

SP(x, d = dist)

SP(x, spatobj = GreHSize)

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

Run the code above in your browser using DataLab