Stack Overflow en español Asked by David Torres V on January 15, 2021
tengo que hacer diagramas de codo aglomerativos y dispersivos y la idea es que queden en la misma figura de ggplot2
En el siguiente codigo obtengo cada diagrama de forma separada. ¿Cómo puedo hacer para que pueda colocar los dos diagramas en la misma figura?
div01 <- ggplot(data = data.frame(t(cstats.table(goWerdistdchomb, divisioneshom, 15))),
aes(x=cluster.number, y=within.cluster.ss)) +
geom_point()+
geom_line(color="gold1")+
ggtitle("Divisive Clustering - Male students") +
labs(x = "Number of clusters", y = "Square sum within clusters") +
theme(plot.title = element_text(hjust = 0.5))
#Agglomerative
aglom01 <- ggplot(data = data.frame(t(cstats.table(goWerdistdchomb, hclust(goWerdistdchomb, method = "complete"), 15))),
aes(x=cluster.number, y=within.cluster.ss)) +
geom_point()+
geom_line(color="violetred")+
ggtitle("Aglomerative Clustering - Male students") +
labs(x = "Number of clusters", y = "Square sum within clusters") +
theme(plot.title = element_text(hjust = 0.5))
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP