plot_pca: Produce a PCA plot from produce_pca_df results

View source: R/PCA.R

plot_pcaR Documentation

Produce a PCA plot from produce_pca_df results

Description

Produce a PCA plot from produce_pca_df results

Usage

plot_pca(
  res_pca,
  size = 3,
  color = NULL,
  shape = NULL,
  show_names = TRUE,
  title = NULL,
  graph = TRUE,
  legend.position = "right",
  legend.box = "vertical"
)

Arguments

res_pca

The list returned from the produce_pca function

size

The size of the points. Default: 3.

color

The name of the column in res_pca$coord to use to color the points in the PCA. If NULL, won't add color. Default: NULL.

shape

The name of the column in res_pca$coord to use to define the shape of the points in the PCA. If NULL, won't add change the shape. Default: NULL.

show_names

Try to add the labels of each point? Will only add the labels if the points are not too closely clustered together in the PCA. Default: TRUE.

title

Add a title to the graph? If NULL, no title is added to the graph. Otherwise this param must be a character. Default: NULL.

graph

Produce the graph. TRUE or FALSE. Default: TRUE.

legend.position

Value for the legend.position param from ggplot2. Default: "right".

legend.box

Value for the legend.box param from ggplot2. Default: "vertical".

Value

Returns the ggplot object

Examples

txi <- get_demo_txi()
res_pca <- produce_pca_df(txi)
p <- plot_pca(res_pca, graph = FALSE)


CharlesJB/rnaseq documentation built on Oct. 17, 2023, 5:37 p.m.