mcu_mds <- cmdscale(d = dist(mcu_scaled), k = 2)
mcu <- mcu |>
mutate(mds1 = mcu_mds[, 1], mds2 = mcu_mds[, 2])
library(ggrepel)
mcu_mds_plot <- mcu |>
ggplot(aes(x = mds1, y = mds2)) +
geom_point(color = "darkblue", size = 2, alpha = 0.5) +
geom_text_repel(aes(label = film), alpha = 0.75, color = "black") +
labs(x = "MDS coordinate 1", y = "MDS coordinate 2") +
theme_light()
mcu_dendro <- mcu_hc_complete |>
ggdendrogram(theme_dendro = FALSE) +
labs(y = "Dissimilarity") +
coord_flip() +
theme_light() +
theme(axis.title.y = element_blank())
library(cowplot)
plot_grid(mcu_mds_plot, mcu_dendro)