mapClusters {geocmeans} | R Documentation |
Build some maps to visualize the results of the clustering
mapClusters(geodata, belongmatrix, undecided = NULL)
geodata |
A object of class spatialpolygonesdataframe / spatiallinesdataframe or spatialpointsdataframe ordered like the original data used for the clustering |
belongmatrix |
The membership matrix obtained at the end of the algorithm |
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) |
A named list with :
ProbaMaps : a list of ggplot maps showing for each group the probability of the observations to belong to that group
ClusterMap : a ggplot map showing the most likely group for observation
data(LyonIris) AnalysisFields <-c("Lden","NO2","PM25","VegHautPrt","Pct0_14","Pct_65","Pct_Img", "TxChom1564","Pct_brevet","NivVieMed") dataset <- LyonIris@data[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)