segdataclean | R Documentation |
The function cleans and prepares the data for segregation analysis
segdataclean (x, c = NULL, b = NULL, a = NULL, p = NULL,
ck = NULL, d = NULL, dc = NULL, spatobj = NULL, folder = NULL, shape = NULL,
warnings = TRUE)
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. |
c |
a standard binary contiguity (adjacency) symmetric matrix where each element Cij equals 1 if i-th and j-th spatial units are adjacent, and 0 otherwise. |
b |
a common boundaries matrix where each element Bij |
a |
a numeric vector containing spatial unit areas |
p |
a numeric vector containing spatial units perimeters. |
ck |
a list containing contiguity matrices coresponding to each order (from 1 to K) |
d |
a matrix of the distances between spatial unit centroids |
dc |
a numeric vector containing the distances between spatial units centroids and the central spatial unit |
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). |
warnings |
- warning alert (by default TRUE) |
The objects (data matrix, geographical vectors/matrices, spatial objects) cleaned from null rows or columns
Other local indices: LQ
,
HLoc
, LShannon
x <- segdata@data[ ,1:2]
x[ ,3] <- rep (0 ,100)
x[1:3, ] <- rep (c(0, 0, 0), 3)
x1 <- x
spatobj <- segdata
cldata <- segdataclean(x1, segdata)
x1 <- cldata$x
spatobj <- cldata$spatobj
c <- contig (segdata)
c <- segdataclean(x, c = c)$c
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.