Ich frage mich, wie ich cbind
Elemente eines summary
eines list
.R - cbind list Zusammenfassung Elemente
Stellen Sie sich vor, ich führe ein Clustering auf 3 Gruppen separat.
Ich verwende für diesen Zweck die ruspini
Daten aus der cluster
Bibliothek.
library(dplyr)
library(cluster)
# Let us create 3 groups
ruspini$group = rep(1:3, 25)
Ich bin zuerst Anwendung einer PAM
Clustering. Dann wende ich eine silhouette
Funktion und schließlich eine summary
an jede Liste an.
fpam = function(x) pam(x, 3)
fsil = function(x) silhouette(x)
ruspiniPAMsil = ruspini %>%
split(.$group) %>%
lapply(fpam) %>%
lapply(fsil) %>%
lapply(summary)
Was Ich mag würde, ist diese
ruspiniPAMsil[[1]]$clus.avg.widths
von jedem Cluster retreive und es zusammen zu binden. Wie kann ich cbind
Elemente einer solchen Liste?
do.call('cbind', ruspiniPAMsil[[i]]) # ??
Die Ausgabe wollte, ist
Group 1 Group 2 Group 3
1 0.6944263 0.6898372 0.5436701
2 0.5286338 0.5129770 0.7421103
3 0.8200596 0.7810391 0.6460008
Danke, was ich gesucht habe. – giacomo