get.cross.PCF {IDSpatialStats} | R Documentation |
Cross type Pair Correlation Function using homotypic and heterotypic case types
Description
A wrapper function of the pcf function from the spatstat.explore package (Baddeley et al. 2016) that takes epidemiological data used by IDSpatialStats functions and calculates the cross type Pair Correlation Function based on user defined case type homology
Usage
get.cross.PCF(epi.data, type, hom, het = NULL, r = NULL, correction = "none")
Arguments
epi.data |
a three-column numerical matrix that contains coordinates ( |
type |
an integer giving the column that contains information on case type. Must be an integer or a character |
hom |
a scalar or vector giving the homotypic case type(s). Equivalent to the 'j' point type used in the cross K function. Must be an integer or character |
het |
a scalar or vector giving the heterotypic case type(s). Equivalent to the 'i' point type used in the cross K function. The default is |
r |
a numeric vector giving the spatial distances |
correction |
type of edge correction to be applied (default set to 'none'). See the pcf function in the spatstat.explore package for more details |
Value
a data frame with two columns giving the radius r
, the theoretical value of the Pair Correlation Function for a Poisson process (theo
), and value of the Pair Correlation Function pcf
Author(s)
John Giles
References
Baddeley A, Rubak E, and Turner R. (2016). "Spatial Point Patterns: Methodology and Applications with R". CRC Press.
Examples
data(DengueSimR01)
g <- get.cross.PCF(epi.data=DengueSimR01, type=5, hom=2, het=NULL, r=NULL, correction='none')
plot(g$pcf, type='l', xlab='r', ylab='cross PCF')
abline(h=1, col='red', lty=2)