From dcf0712abe2fc198796c1dccc66d78b4f3cf82a2 Mon Sep 17 00:00:00 2001 From: JoseCorCab Date: Fri, 19 Jul 2024 11:34:52 +0200 Subject: [PATCH] Eigenvector distributions are now represented --- inst/templates/facto_miner.Rmd | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/inst/templates/facto_miner.Rmd b/inst/templates/facto_miner.Rmd index 97efe02..1283c98 100644 --- a/inst/templates/facto_miner.Rmd +++ b/inst/templates/facto_miner.Rmd @@ -21,11 +21,28 @@ ggplot2::labs(x = "", y = "Percentage of total variance")+ ggplot2::scale_y_continuous(sec.axis = ggplot2::sec_axis(~./100, name = "Cumulative percentage of variance", labels = scales::percent)) + ggplot2::theme(legend.position = "bottom", axis.text.x = ggplot2::element_text(angle = 45, hjust = 1)) +``` +#### **Distribution of Eigenvectors** +The eigenvector contains the weights of each gene for the PC. Here are represented the distributions of the weights of each eigenvector. +The vertical lines represent the quantiles. -``` +```{r , echo = FALSE, warning =FALSE, message=FALSE, results = 'asis', fig.width = 5, fig.height = 4 } +eig_dist <- pca_data$svd$V +colnames(eig_dist) <- colnames(pca_data$var$cor) +eig_dist <- reshape2::melt(eig_dist) + +ggplot2::ggplot(eig_dist, ggplot2::aes(x = value, + y = Var2)) + +ggridges::geom_density_ridges(jittered_points = TRUE, + position = "raincloud", + alpha = 0.7, + scale = 0.9, + quantile_lines = TRUE) + +ggplot2::theme_classic() +``` #### **Comparison of significant dimensions significant dimensions**