Learn R Programming

seg (version 0.1-0)

spseg: Calculate Spatial Segregation Measures

Description

Calculate Reardon and O'Sullivan's four spatial segregation measures.

Usage

spseg(x, data, method = "all", smoothing = "none", nrow = 100, 
      ncol = 100, window, sigma, useC = TRUE, verbose = FALSE, ...)
SegSpatial(env, method = "all", useC = TRUE)

Arguments

x
a numeric matrix or data frame with coordinates (each row is a point), or an object of class Spatial or ppp.
env
an object of class SegLocalEnv.
data
an object of class matrix, or one that can be coerced to that class. The number of rows in data should equal the number of points in x, and the number of columns should be greater than one (at least two popul
method
a vector of character strings indicating an measure or measures to be computed. This must be one or more of the strings "all" (default), "exposure", "information", "diversity", and "dissimilarity". Abbreviations are accepted, as long as it is clear which
smoothing
a character string indicating a smoothing method. This must be (an abbreviation of) one of the strings "none" (default), "kernel", or "equal".
nrow
an optional numeric value indicating the number of row cells in the rasterised data surface. Ignored if smoothing = "none".
ncol
an optional numeric value indicating the number of column cells.
window
an optional object of class owin to be passed to smooth.ppp. See Details.
sigma
an optional numeric value specifying standard deviation of isotropic Gaussian smoothing kernel to be passed to smooth.ppp. See also Details.
useC
logical. If TRUE, calculate the segregation values in C.
verbose
logical. If TRUE, print the current stage of the computation and time spent on each job to the screen.
...
optional arguments to be passed to getLocalEnv to compute the population composition of each local environment.

Value

  • An object of class SegSpatial.

Details

SegSpatial computes the set of spatial segregation measures proposed by Reardon and O'Sullivan.

spseg is a wrapper function, which calls SegSpatial after constructing a population density surface and its local environment parameters with user-specified options. Currently the population density surface is estimated using the rasterize function in the raster package if the population density is assumed to be uniform in each census tract, or using smooth.ppp in the spatstat package if the kernel density estimation is to be used. The local environment parameters are calculated based on the output surface using getSegLocalEnv.

References

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

Reardon, S. F., Farrell, C. R., Matthews, S. A., O'Sullivan, D., Bischoff, K., and Firebaugh, G. (2009) Race and space in the 1990s: Changes in the geographic scale of racial residential segregation, 1990-2000. Social Science Research, 38, 55-70.

See Also

getSegLocalEnv, SegSpatial-class, rasterize, smooth.ppp

Examples

Run this code
# Create a random data set with 50 data points and 3 population groups
xy <- matrix(runif(100), ncol = 2)
pop <- matrix(runif(150), ncol = 3)
r1 <- spseg(xy, pop, smoothing = "kernel", maxdist = 0.5)
r2 <- spseg(xy, pop, smoothing = "kernel", useExp = FALSE, 
            power = 0, maxdist = 0.5)
print(r2, digits = 3)

# Auckland population data set
data(auckpop2006)
r3 <- spseg(auckpop2006, smoothing = "kernel", maxdist = 3000)
r4 <- spseg(auckpop2006, smoothing = "equal", maxdist = 100)
r5 <- spseg(auckpop2006, smoothing = "equal", maxdist = 3000)
r6 <- spseg(auckpop2006, smoothing = "kernel", nrow = 300, ncol = 300, 
            maxdist = 3000, verbose = TRUE)

Run the code above in your browser using DataLab