Skip to content

Identify hotspots (centroid/geometric center when CSR distance is not satisfied) using K-Ripley approach

1 message · ASANTOS

#
Dear R-sig-geo Members,

 ??? ??? I've like to identify hotspots points (centroid/geometric 
center of distances(r) when CSR is not satisfied), in my study case, 
centroids with points around 0.75 radius. This thinking in the map 
representation, for this objective I make:

#Package
library(spatstat)
library(sp)
library(cluster)
library(lattice)

#Swedishpines's data set in spatstat package
data(swedishpines)
plot(swedishpines)

#CSR with K-Ripley test
csr_pines <- envelope(swedishpines, Kest, nsim=99)
plot(csr_pines)
# r=0.75 is outside CSR assumption, than:

##Create matrix distance of all points
coords<-cbind(swedishpines$x,swedishpines$y)
res<-spDists(coords)
res <- data.frame(res)

# Cluster 0.75m distances
clusters <- as.hclust(agnes(res, diss = T))
coords$group <- cutree(clusters, h=0.75) ## Radius 0.75
#

#Visualization of centroids with points around 0.75 radius
xyplot(x~y, group = group, data = coords)
points(swedishpines$x,swedishpines$y, pch=16)
#

Doesn't work, please any ideas or new approaches?

Thanks in advanced,

Alexandre