Skip to content

Commit

Permalink
small tweaks to streamlining, complete task 29
Browse files Browse the repository at this point in the history
  • Loading branch information
mallewellyn authored Mar 5, 2024
1 parent 247bb02 commit 02054a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions _episodes_rmd/04-principal-component-analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ is by creating a biplot. Biplots usually show two principal components plotted
against each other. Observations are sometimes labelled with numbers. The
contribution of each original variable to the principal components displayed
is then shown by arrows (generated from those two columns of the rotation matrix that
correspond to the principal components shown). NB, there are several biplot
correspond to the principal components shown). See `help("PCAtools::biplot")` for
arguments and their meaning. For instance, `lab` or `colBy` may be useful.
Note that there are several biplot
implementations in different R libraries. It is thus a good idea to specify
the desired package when calling `biplot()`. A biplot of the first two principal
components can be generated as follows:
Expand Down Expand Up @@ -639,7 +641,7 @@ proportion of variance explained.
> > ```{r scree-ex, fig.cap="Caption", fig.cap="Alt"}
> > pc <- pca(mat, metadata = metadata)
> > screeplot(pc, axisLabSize = 5, titleLabSize = 8, drawCumulativeSumLine = FALSE,
> > drawCumulativeSumPoints > > = FALSE) + geom_line(aes(x = 1:length(pc$components), y =
> > drawCumulativeSumPoints = FALSE) + geom_line(aes(x = 1:length(pc$components), y =
> > as.numeric(pc$variance))) #add line to scree plot to visualise the elbow
> > ```
> >
Expand Down Expand Up @@ -673,8 +675,7 @@ are two functions called `biplot()`, one in the package **`PCAtools`** and one i
> ## Challenge 5
>
> Create a biplot of the first two principal components from your PCA
> using `biplot()` function in **`PCAtools`**. See `help("PCAtools::biplot")` for
> arguments and their meaning. For instance, `lab` or `colBy` may be useful.
> using `biplot()` function in **`PCAtools`**.
>
> Examine whether the data appear to form clusters. Explain your results.
>
Expand Down

0 comments on commit 02054a9

Please sign in to comment.