xPy: A function to compute interaction index (xPy)

Description Usage Arguments Value References See Also Examples

View source: R/SegFunctions.R

Description

The interaction index, xPy, is an exposure between groups index which measures the probability that a member of a group shares the same spatial unit with a member of another group. The index can be calculated with the approximate or exact method (see Bell, 1954).

Usage

1
xPy(x, exact = FALSE)

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.

exact

- a logical variable to specifiy the index version: exact = FALSE (by default) for the approximate version of the index, and exact = TRUE for the exact version

Value

a matrix with interaction index values

References

Bell W. (1954) A probability model for the measurement of ecological segregation. Social Forces 32(4), pp. 357-364

See Also

Isolation indices: xPx, Eta2, DPxx

Distance decay interaction index: DPxy

Examples

1
2
x <- segdata@data[ ,1:2]
xPy(x) 

Example output

     [,1] [,2]
[1,]    1    0
[2,]    0    1

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

Related to xPy in OasisR...