Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fac2col

Utility function to translate a factor into colors


Description

Utility function to translate a factor into colors

Usage

fac2col(
  x,
  s = 1,
  v = 1,
  shuffle = FALSE,
  min.group.size = 1,
  return.details = FALSE,
  unclassified.cell.color = "gray50",
  level.colors = NULL
)

Arguments

x

input factor

s

numeric The "saturation" to be used to complete the HSV color descriptions (default=1) See ?rainbow in Palettes, grDevices

v

numeric The "value" to be used to complete the HSV color descriptions (default=1) See ?rainbow in Palettes, grDevices

shuffle

boolean If TRUE, shuffles columns with shuffle(columns) (default=FALSE)

min.group.size

integer Exclude groups of size less than the min.group.size (default=1)

return.details

boolean If TRUE, returns a list list(colors=y, palette=col). Otherwise, just returns the factor (default=FALSE)

unclassified.cell.color

Color for unclassified cells (default='gray50')

level.colors

(default=NULL)

Value

vector or list of colors

Examples

genes = factor(c("BRAF", "NPC1", "PAX3", "BRCA2", "FMR1"))
fac2col(genes)

sccore

Core Utilities for Single-Cell RNA-Seq

v0.1.3
GPL-3
Authors
Viktor Petukhov [aut], Ramus Rydbirk [aut], Peter Kharchenko [aut], Evan Biederstedt [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.