From 95129a51b7628975f13d6e6e33394c6a16f77755 Mon Sep 17 00:00:00 2001 From: Laurent Modolo <laurent.modolo@ens-lyon.fr> Date: Wed, 21 Sep 2022 21:51:02 +0200 Subject: [PATCH] reveal some figures in practicals with echo=F --- Practical_a.Rmd | 12 ++++++------ Practical_b.Rmd | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Practical_a.Rmd b/Practical_a.Rmd index bf4c0bb..f10baa8 100644 --- a/Practical_a.Rmd +++ b/Practical_a.Rmd @@ -437,7 +437,7 @@ To obtain the following figure you will need to write the body of the `point_pro Then you will need to compute the `slope` value for the `geom_abline` function from the `diy_cov` results. </div> -```{r include=FALSE, echo=T} +```{r echo=F} point_projection <- function(diy_cov, x, y){ a <- c(x, y) b <- eigen(diy_cov)$vector[, 1] @@ -544,7 +544,7 @@ We are now going to plot the second principal component and the projection of th Adapt your previous code to perform the computation on the PC2 </div> -```{r include=FALSE, echo=T} +```{r echo=F} point_projection <- function(diy_cov, x, y){ a <- c(x, y) b <- eigen(diy_cov)$vector[, 2] @@ -654,7 +654,7 @@ For 3 variables ? You can merge your previous computation to plot the projection on the 2 first PCs </div> -```{r include=FALSE, echo=T} +```{r echo=F} point_projection <- function(diy_cov, x, y, PC){ a <- c(x, y) b <- eigen(diy_cov)$vector[, PC] @@ -894,7 +894,7 @@ pc_var / sum(pc_var) The `fviz_eig` function create a scree plot of your PCA. -```{r include=FALSE, echo=T} +```{r echo=F} fviz_eig(data_f_pca) ``` @@ -934,7 +934,7 @@ It means that if `bill_depth_mm` contribute for 1 to PC1, `bill_length_mm` contr As the number of variables increases, so is the complexity of the linear combinations for each PC. We can represent the variable axis in the new PCA axis, this representation is called the correlation circle. -```{r, include=F, echo=T} +```{r, echo=F} fviz_pca_var(data_f_pca, col.var = "contrib") ``` @@ -949,7 +949,7 @@ Use the `str()` function to find this information in the `data_f_pca` object Finally, we can use the `fviz_pca_biplot` function to display the individuals and variable information on the same plot. -```{r, include=F, echo=T} +```{r, echo=F} fviz_pca_biplot( data_f_pca, geom = "point", col.ind = (data %>% filter(sex == "female") %>% pull(species)), diff --git a/Practical_b.Rmd b/Practical_b.Rmd index 3c69c0d..cfeb877 100644 --- a/Practical_b.Rmd +++ b/Practical_b.Rmd @@ -214,7 +214,7 @@ data_pca <- data[var_gene_2000[1:600], ] %>% </p> </details> -```{r, include=F, echo=T} +```{r, echo=F} data_pca %>% fviz_pca_ind( geom = "point", @@ -384,7 +384,7 @@ Why is the `centers` parameter required for `kmeans()` and not for the `hclust() We want to compare the cells annotation to our clustering. -```{r, include=F, echo=T} +```{r, echo=F} data_pca %>% fviz_pca_ind( geom = "point", @@ -396,7 +396,7 @@ data_pca %>% Using the `str()` function make the following plot from your k-means results. </div> -```{r, include=F, echo = T} +```{r, echo = F} data_pca %>% fviz_pca_ind( geom = "point", -- GitLab