PCAPlots: PCA Plots

Description Usage Arguments Value See Also

Description

A group of functions for PCA plots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pca(
  df,
  A,
  B = NULL,
  title = "PCA",
  col = colpal,
  nameA = "subtypeA",
  nameB = "subtypeB",
  point.size = 4,
  shapes = c(16:18, 15),
  plot.it = TRUE,
  return.data = FALSE
)

pca_multi(
  df,
  subtype = NULL,
  n = 6,
  col = colpal,
  title = NULL,
  plot.it = TRUE
)

pca_bg(
  df,
  subtype,
  col = colpal,
  legend.name = NULL,
  point.size = 6,
  text.size = 26,
  mar = 15,
  plot.it = TRUE
)

Arguments

df

numeric dataframe with rows of samples and columns of features

A, B, subtype

character vector of the subtypes of samples

col

color to be used for each subtype.

plot.it

if FALSE, no plot printed, only return the plot object

n

for pca_multi, number of PCs to be plotted

mar

for pca_bg, margin between the points to the frame.

"+"

use + to add ggplot layers for more customization

Value

Print the plot and return the plot

See Also

autoplot and prcomp


brightchan/cjbmisc documentation built on Nov. 5, 2021, 4:12 p.m.