Description Usage Arguments Value Examples
Create a vector of hex colours from numeric values, typically diffusion scores
1 2 3 4 5 6 | scores2colours(
x,
range = c(min(0, min(x)), max(x)),
n.colors = 10,
palette = colorRampPalette(c("#3C5488FF", "white", "#F39B7FFF"))
)
|
x |
numeric vector to be colorised |
range |
range of values to filter |
n.colors |
integer, number of colors in the palette |
palette |
palette function that generates a scale of
colours given the number of desired colours. Defaults to a
blue-white-red scale by |
Character vector with hex colours
1 2 | set.seed(1)
scores2colours(runif(20))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.