get_color_palette: Get a Color Palette

Description Usage Arguments Details Value See Also Examples

View source: R/palettes.R

Description

Get a color palette with a specific number of colors.

Usage

1
2
get_color_palette(pal_func = viridis_magma_palette, color_no = 20,
  display = TRUE, rev = FALSE, ...)

Arguments

pal_func

A function that returns the output function from colorRamp or a the output of the output function from colorRamp. Default: viridis_magma_palette

color_no

The number of colors in the palette. Default: 20

display

A logical for displaying a pie chart of the palette. Default: TRUE

rev

A logical that will reverse the order of the color palette.

...

Parameters for the pal_func.

Details

This function is meant to be a plugin style function for users to created palettes.

Value

Returns a color palette in the form of a character vector.

See Also

Other Color Palettes: combination_palette, scico_palette, viridis_magma_palette, viridis_palette

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
if(interactive()){
# This example uses data that are no longer available in the MicrobiomeR package,
# however, they can be easily generated with \code{\link{MicrobiomeR}{as_analyzed_format}}.
 library(MicrobiomeR)
analyzed_silva <- as_MicrobiomeR_format(MicrobiomeR::raw_silva_2, "analyzed_format")
 data <- analyzed_silva$data$stats_tax_data$Phylum
 data_len <- length(unique(data))
 custom_pal <- get_color_palette(color_no=data_len)
 print(custom_pal)
 }

## End(Not run)

vallenderlab/MicrobiomeR documentation built on Aug. 30, 2019, 11:24 p.m.