make_colors {ontophylo} | R Documentation |
Produces a color scale for a given statistic of evolutionary rate.
make_colors(Stat, palette)
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. |
A character vector where elements are color IDs and names are the input ontology term labels.
Sergei Tarasov
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(stat, palette = hm.palette(100))
cols.maps