make_colors_relative_scale {ontophylo} | R Documentation |
Make color palette for image plotting with relative scale
Description
Produces a relative color scale for a given statistic of evolutionary rate.
Usage
make_colors_relative_scale(Stat, palette, lims)
Arguments
Stat |
numeric. A named vector where values are the statistics, and names are ontology term labels. |
palette |
A character vector or function defining a color palette. |
lims |
numeric. A pair of values defining the lower and upper limits of the scale. |
Value
A character vector where elements are color IDs and names are the input ontology term labels.
Author(s)
Sergei Tarasov
Examples
stat <- setNames(runif(5, 0.1, 10),
c("cranium", "fore_wing", "hind_wing", "pronotum", "propectus") )
hm.palette <- colorRampPalette(RColorBrewer::brewer.pal(9, "Spectral"), space = "Lab")
cols.maps <- make_colors_relative_scale(stat, palette = hm.palette(100),
lims = c(min(stat), max(stat)))
cols.maps
[Package ontophylo version 1.1.3 Index]