summarizeClusters | R Documentation |
Calculate some descriptive statistics of each group
summarizeClusters(data, belongmatrix, weighted = TRUE, dec = 3, silent = TRUE)
data |
The original dataframe used for the classification |
belongmatrix |
A membership matrix |
weighted |
A boolean indicating if the summary statistics must use the membership matrix columns as weights (TRUE) or simply assign each observation to its most likely cluster and compute the statistics on each subset (FALSE) |
dec |
An integer indicating the number of digits to keep when rounding (default is 3) |
silent |
A boolean indicating if the results must be printed or silently returned |
A list of length k (the number of group). Each element of the list is a dataframe with summary statistics for the variables of data for each group
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)
summarizeClusters(dataset, result$Belongings)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.