spseg(x, data, method = "all", smoothing = "none", nrow = 100, 
      ncol = 100, window, sigma, useC = TRUE, negative.rm = FALSE, 
      tol = .Machine$double.eps, verbose = FALSE, ...)
SegSpatial(env, method = "all", useC = TRUE, negative.rm = FALSE, 
           tol = .Machine$double.eps)Spatial or ppp.SegLocalEnv.matrix, or one that can be coerced to that class. The number of rows in owin to be passed to smooth.ppp. See density.ppp. See also .Machine$double.eps. See help(.Machine)getLocalEnv to compute the population composition of each local environment.SegSpatialExt.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 density.ppp in the getSegLocalEnv.getSegLocalEnv, SegSpatial-class, rasterize, density.ppp# 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)
rana <- spseg(xy, pop, smoothing = "kernel", maxdist = 0.5)
ranb <- spseg(xy, pop, smoothing = "kernel", useExp = FALSE, 
            power = 0, maxdist = 0.5)
print(ranb, digits = 3)
par(mfrow = c(1, 3), mar = c(0, 1, 0, 2.5))
plot(ranb, main = "")Run the code above in your browser using DataLab