color_biplot_by_discrete: Colors a biplot according to a vector with discrete values

View source: R/hypergate.R

color_biplot_by_discreteR Documentation

Colors a biplot according to a vector with discrete values

Description

Colors a biplot according to a vector with discrete values

Usage

color_biplot_by_discrete(
  matrix,
  discrete_vector,
  ...,
  bty = "l",
  pch = 16,
  cex = 0.5,
  colors = NULL
)

Arguments

matrix

a two columns matrix

discrete_vector

a vector of size nrow(matrix)

...

passed to plot

bty

passed to plot

pch

passed to plot

cex

passed to plot

colors

Palette to used named after the unique elements of discrete_vector. Generated from rainbow() if missing.

Examples

data(Samusik_01_subset)
levels=unique(sort(Samusik_01_subset$labels))
colors=setNames(colorRampPalette(palette())(length(levels)),sort(levels))
with(Samusik_01_subset,color_biplot_by_discrete(matrix=tsne,discrete_vector=labels,colors=colors))

hypergate documentation built on Aug. 31, 2023, 5:12 p.m.