View source: R/Seurat.Utils.Visualization.R
DiscretePaletteSafe | R Documentation |
Generates a discrete color palette, ensuring no NA values are included, suitable for visualizations where a specific number of distinct, reproducible colors is needed.
DiscretePaletteSafe(
n,
palette.used = c("alphabet", "alphabet2", "glasbey", "polychrome", "stepped")[2],
show.colors = FALSE,
seed = 1989
)
n |
Number of colors to generate. |
palette.used |
Palette name to use for generating colors. Options include "alphabet", "alphabet2", "glasbey", "polychrome", "stepped". Default: "alphabet2". |
show.colors |
If TRUE, displays the generated color palette. Default: |
seed |
Seed value for reproducibility, especially when random color generation is involved. Default: 1989. |
Character vector of HEX color values.
## Not run:
colors <- DiscretePaletteSafe(n = 10)
print(colors)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.