mapClusters {geocmeans} | R Documentation |
Mapping the clusters
Description
Build some maps to visualize the results of the clustering
Usage
mapClusters(geodata = NULL, object, undecided = NULL)
Arguments
geodata |
An object of class features collection from sf / ordered like the original data used for the clustering. Can be Null if object is a FCMres and has been created with rasters. |
object |
A FCMres object, typically obtained from functions CMeans, GCMeans, SFCMeans, SGFCMeans. Can also be a simple membership matrix. |
undecided |
A float between 0 and 1 giving the minimum value that an observation must get in the membership matrix to not be considered as uncertain (default = NULL) |
Value
A named list with :
ProbaMaps : a list of tmap maps showing for each group the probability of the observations to belong to that group
ClusterMap : a tmap map showing the most likely group for observation
Examples
## Not run:
data(LyonIris)
AnalysisFields <-c("Lden","NO2","PM25","VegHautPrt","Pct0_14","Pct_65","Pct_Img",
"TxChom1564","Pct_brevet","NivVieMed")
dataset <- sf::st_drop_geometry(LyonIris[AnalysisFields])
queen <- spdep::poly2nb(LyonIris,queen=TRUE)
Wqueen <- spdep::nb2listw(queen,style="W")
result <- SFCMeans(dataset, Wqueen,k = 5, m = 1.5, alpha = 1.5, standardize = TRUE)
MyMaps <- mapClusters(LyonIris, result$Belongings)
## End(Not run)
[Package geocmeans version 0.3.4 Index]