
The website of the package is availablehere
Here we are! We are moving frommaptools,sp,rgeos,raster andrgdal tosf,terra andtmap. All the functions and the documentation were modifiedaccordingly. If you spot an error or a bug, please open an issue ongithub.
The stable version ofgeocmeans is available on CRAN.You can install it with the command below.
install.packages("geocmeans")You can install a development version of thegeocmeanspackage using the command below.
remotes::install_github(repo = "JeremyGelb/geocmeans", build_vignettes = TRUE, force = TRUE)Jeremy Gelb, Laboratoire d’Équité Environnemental INRS (CANADA),Email:jeremy.gelb@ucs.inrs.ca
Philippe Apparicio, Laboratoire d’Équité Environnemental INRS(CANADA), Email:philippe.apparicio@ucs.inrs.ca
Provides functions to apply Spatial Fuzzy c-means Algorithm,visualize and interpret results. This method is well suited when theuser wants to analyze data with a fuzzy clustering algorithm and toaccount for the spatial dimension of the dataset. In addition, indexesfor measuring the spatial consistency and classification quality areproposed. The algorithms were developed first for brain imagery asdescribed in the articles ofCai and al. 2007andZaho andal. 2013.Gelb andApparicio proposed to apply the method to perform asocio-residential and environmental taxonomy in Lyon (France). Themethods can be applied to dataframes or to rasters.
Four Fuzzy classification algorithms are proposed :
CMeansGFCMeansSFCMeansSGFCMeansEach function return a membership matrix, the data used for theclassification (scaled if required) and the centers of the clusters.
For each algorithm, it is possible to calculate a “robust version”and to add a noise group (used to catch outliers). See the parametersrobust andnoise_cluser in the documentationfor more details.
The algorithms available require different parameters to be fixed bythe user. The functionselectParameters is a useful tool tocompare the results of different combinations of parameters. A multicoreversion,selectParameters.mc, using a plan from the packagefuture is also available to speed up the calculus.
Many indices of classification quality can be calculated with thefunctioncalcqualityIndexes:
fclust::SIL.F)fclust::PE)fclust::PC)fclust::MPC)fclust::XB)geocmeans::calcFukuyamaSugeno)geocmeans::calcDavidBouldin)geocmeans::calcCalinskiHarabasz)geocmeans::calcGD43 andcalcGD53)geocmeans::calcNegentropyI)To assess the stability of the obtained clusters, a function forbootstrap validation is proposed:boot_group_validation.The results can be used to verify if the obtained clusters are stableand how much their centres vary.
Clustering methods like CMeans depend on the initial centersselected. Ingeocmeans, they are selected randomly, and tworuns of the functions can yield different results. To facilitate thereproductibility of the results, the main functions of the package(CMeans,GFCMeans,SFCMeans,SGFCMeans,selectParameters,selectParameters.mc) have aseed parameter. Itcan be set by the user to ensure that the results of the functions areexactly the same.
Several functions are also available to facilitate the interpretationof the classification:
summarizeClusters(also accessible with the generic functionsummary)spiderPlotsviolinPlotsmapClusters (supportpolygon, points and polylines)There is also a shiny app that can be used to go deeper in the resultinterpretation. It requires the packagesshiny,leaflet,bslib,plotly,shinyWidgets,car.

Several spatial indices can be calculated to have a better spatialunderstanding of the obtained clusters, like the global or local Moran Icalculated on the membership values, or the join-count-test on the mostlikely group for each observation. ELSA and Fuzzy ELSA statistics canalso be calculated to identify areas with high or low multidimensionalspatial autocorrelation in the membership values. See functionsspConsistency,calcELSA,calcFuzzyELSA andspatialDiag.
We proposed an index to quantify the spatial inconsistency of aclassification (Gelband Apparicio). If in a classification close observations tend tobelong to the same group, then the value of the index is close to 0. Ifthe index is close to 1, then the belonging to groups is randomlydistributed in space. A value higher than one can happen in the case ofnegative spatial autocorrelation. The index is described in the vignetteadjustinconsistency. The functionspatialDiagdoes a complete spatial diagnostic of the membership matrix resultingfrom a classification.
Detailed examples are given in the vignetteintroduction
vignette("introduction","geocmeans")If you would like to install and run the unit tests interactively,includeINSTALL_opts = "--install-tests" in theinstallation code.
remotes::install_github(repo = "JeremyGelb/geocmeans", build_vignettes = TRUE, force = TRUE, INSTALL_opts = "--install-tests")testthat::test_package("geocmeans", reporter = "stop")To contribute togeocmeans, please follow theseguidelines.
Please note that thegeocmeans project is released withaContributorCode of Conduct. By contributing to this project, you agree to abideby its terms.
geocmeans version 0.3.4 is licensed underGPL2License.