segdataclean: A function to clean and prepare the data for segregation...

View source: R/SegFunctions.R

segdatacleanR Documentation

A function to clean and prepare the data for segregation analysis

Description

The function cleans and prepares the data for segregation analysis

Usage

segdataclean (x, c = NULL, b = NULL, a = NULL, p = NULL, 
ck = NULL, d = NULL, dc = NULL, spatobj = NULL, folder = NULL, shape = NULL, 
warnings = T)

Arguments

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)

Value

The objects (data matrix, geographical vectors/matrices, spatial objects) cleaned from null rows or columns

See Also

Other local indices: LQ, HLoc, LShannon

Examples

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


OasisR documentation built on Aug. 30, 2023, 1:09 a.m.

Related to segdataclean in OasisR...