Learn R Programming

delimtools (version 0.2.0)

delim_brewer: Customize Delimitation Colors

Description

delim_brewer() returns a set of colors created by interpolating or using color palettes from RColorBrewer, viridisLite or randomcoloR.

Usage

delim_brewer(delim, package = NULL, palette = NULL, seed = NULL)

Value

A character vector of hexadecimal color codes.

Arguments

delim

Output from delim_join.

package

Package which contains color palettes. Available options are "RColorBrewer", "viridisLite" or "randomcoloR".

palette

A palette name. brewer.pal for RColorBrewer or viridis for viridisLite options.

seed

Integer. Number to initialize random number generator.

Author

Rupert A. Collins, Pedro S. Bittencourt

Details

delim_brewer() interpolates over a color palette and returns a vector of random colors whose length is equal to the sum of unique species delimitation partitions in delim. For reproducibility, make sure to provide a seed. If not provided, Sys.time will be used as seed instead. One should also try different seeds to get best color combinations for plotting.

Examples

Run this code

# create a vector of colors
cols <- delim_brewer(geophagus_delims, package = "randomcoloR")

Run the code above in your browser using DataLab