# \donttest{
###################################
## loading data
library(SPARTAAS)
data(datarcheo)
data(datacancer)
###################################
### Example: 1
## Function "mapclust"
# object <- mapclust( coord = ..., var = ..., label = ...)
classification <- mapclust(datarcheo$coord, datarcheo$var, datarcheo$label, n=4)
#Global dendrogram
classification$dendrogram
#Cut dendrogram
classification$cuttree
#silhouette of selected partition
classification$silhouette
#You can cut the dendrogram for another dlim
NewCut <- mapclust_cut_tree(classification, dlim=0.30)
#See evaluation using Silhouette width by running:
NewCut$silhouette
#If the plot is empty try to increase the height of the window (full screen)
#See summary of the data by running:
summary(NewCut$silhouetteData)
###################################
## kmeans comparison
# pepare data (only geographical data)
datakmeans <- datarcheo$coord
#kmeans
number_cluster <- 4
cl <- kmeans(datakmeans, number_cluster)
plot(datakmeans, col = cl$cluster)
# }
Run the code above in your browser using DataLab