get.cross.K | R Documentation |
A wrapper function of the Kcross function from the spatstat.explore package (Baddeley et al. 2016) that takes epidemiological data used by IDSpatialStats functions and calculates the cross type K-function based on user defined case type homology
get.cross.K(epi.data, type, hom, het = NULL, r = NULL, correction = "none")
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 Kcross function in the spatstat.explore package for more details |
a data frame with a minimum of three columns giving the radius (r
), the theoretical value of the K function for a Poisson process (theo
), and value of the K function evaluated at radius r
. The column name gives the type of edge correction used
John Giles
Baddeley A, Rubak E, and Turner R. (2016). "Spatial Point Patterns: Methodology and Applications with R". CRC Press.
data(DengueSimR01)
k <- get.cross.K(epi.data=DengueSimR01, type=5, hom=2, het=NULL, r=NULL, correction='border')
plot(k[,2], type='l', col='red', lty=2, xlab='r', ylab='cross K function')
lines(k$border)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.