DPxx: A function to compute the distance-decay isolation index...

Description Usage Arguments Value References See Also Examples

View source: R/SegFunctions.R

Description

The distance decay isolation index, DPxx, is a spatial adaptation of isolation index xPx. The function can be used in two ways: to provide a distance matrix or a external geographic information source (spatial object or shape file).

Usage

1
2
DPxx(x, d = NULL, distin = 'm',  distout = 'm', diagval = '0', beta = 1, 
spatobj = NULL, folder = NULL, shape = NULL)

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.

d

- a matrix of the distances between spatial unit centroids

distin

- input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc.

distout

- output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc.

diagval

- when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983)

beta

- distance decay parameter

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).

Value

a numeric vector containing the distance-decay isolation index value for each group

References

Morgan, B. S. (1983) A Distance-Decay Based Interaction Index to Measure Residential Segregation. Area 15(3), pp. 211-217.

See Also

Isolation indices: xPx, Eta2

Interaction indices: xPy, DPxy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- segdata@data[ ,1:2]
ar <- area(segdata)
dist <- distance(segdata)
diag(dist)<-sqrt(ar) * 0.6
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'segdata'

DPxx(x, d = dist)

DPxx(x, spatobj = segdata, diagval = 'a')

DPxx(x, folder = foldername, shape = shapename, diagval = '0') 

Example output

Loading required package: sp
[1] 0.7688 0.9229
[1] 0.7688 0.9229
OGR data source with driver: ESRI Shapefile 
Source: "/usr/lib/R/site-library/OasisR/extdata", layer: "segdata"
with 100 features
It has 19 fields
[1] 0.7882 0.9294

OasisR documentation built on July 2, 2020, 3:14 a.m.

Related to DPxx in OasisR...