The aim of this package is to propose a method for detecting clusters of points in bi-dimensional space. Our method allows to account for a covariate in the clustering. The package proposes a graphical visualization of the clusters.
To install and load the package in R
library(devtools)
install_github("MathieuEmily/SpatialClustering")
library(SpatialClustering)
Example of a study of tree location
data(dataExample)
Extraction of the data and the window
dDicor <- dataExample$data
w0 <- dataExample$w0
set.seed(123)
res <- SpatialClustering(data=dDicor,window=w0)
The group memberships
res$group
Various plotting possibilities
plot(res)
plot(res,plot.dendro=FALSE)
plot(res,method="Seg",plot.dendro=FALSE)
plot(res,method="Seg",plot.dendro=TRUE)
Extraction of the covariate
Z.Pente <- dataExample$Z.Pente
Estimation of the cluster
set.seed(345)
res.I <- SpatialClustering(data=dDicor,window=w0,Homogeneous=FALSE,Z=Z.Pente)
plot(res.I)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.