scal_var: Generate a scaled variance plot for an integrative embedding

View source: R/scal_var.R

scal_varR Documentation

Generate a scaled variance plot for an integrative embedding

Description

Generate a scaled variance plot for an integrative embedding

Usage

scal_var(
  inp,
  batchvec = NULL,
  pcs = seq(3),
  returngg = FALSE,
  showplot = TRUE,
  plot_subtitle = NULL
)

Arguments

inp

corralm object or matrix; embedding to compute scaled variances

batchvec

vector; batch labels (can be numeric or char). Defaults to 'NULL', which is appropriate for using a corralm object. If using an embedding matrix for inp, then this argument must be given and length must correspond to number of rows in 'inp'.

pcs

numeric; vector of which PCs should be shown. Defaults to 1:3

returngg

boolean; whether or not to return a ggplot2 object, defaults FALSE

showplot

boolean; whether or not to show the plot, defaults TRUE

plot_subtitle

string; the text that should show in the subtitle for the plot. defaults to NULL

Value

N/A or a ggplot object

Examples

dat <- matrix(rnorm(10000), ncol = 50)
bv <- rep(seq(4),c(10,30,60,100))
scal_var(dat,bv, pcs = seq(4))

laurenhsu1/corral documentation built on Feb. 19, 2023, 10:37 p.m.