pca_biplot: PCA biplot

View source: R/pca.R

pca_biplotR Documentation

PCA biplot

Description

Draws a PCA biplot for a prcomp or princomp result.

Usage

pca_biplot(
  dataset,
  pca.result,
  cex = 0.8,
  legend.cex = 0.8,
  x.colors = 1,
  inset = c(0, 0),
  legend.place = "topright",
  ...
)

Arguments

dataset

Dataset used in the PCA.

pca.result

PCA result object.

cex

Text expansion factor.

legend.cex

Legend text size.

x.colors

Colour vector or metadata column name.

inset

Legend inset.

legend.place

Legend position.

...

Additional arguments passed to the plotting method.

Value

No return value, called for its side effect of plotting.

Examples

datamat <- matrix(
  rnorm(20),
  nrow = 4,
  dimnames = list(paste0("x", 1:4), paste0("s", 1:5))
)
metadata <- data.frame(class = factor(c("A", "A", "B", "B", "A")))
dataset <- list(data = datamat, metadata = metadata)
pca_res <- pca_analysis_dataset(dataset)
pca_biplot(dataset, pca_res)


specmine documentation built on Aug. 5, 2026, 5:06 p.m.