I am using spatstat to run Kcross: Multitype K Function (Cross-type). Here is my data set and here is the script plotting K Cross
df <- read.csv(file = "trees_rocks.csv")
df.test <- filter(df, Class %in% c("TREE", "ROCK"))
x.range <- range(df.test$coord_x)
y.range <- range(df.test$coord_y)
test.ppp <- ppp(
df.test$coord_x, df.test$coord_y,
x.range, y.range, marks = factor(df.test$Class))
plot(envelope(test.ppp, Kcross, nsim = 10), xlim = c(0, 100))
The graph nicely illustrates the degree of clustering. However, I would get more precise information from the graph. How can I get the area under the curve? More precisely, how can I calculate the area between the red dashed line and the black solid line?
I tried to figure out how to run auc()
(LINK) but since I don't have any covariate, I don't know how to proceed.
Thank you all in advance!