scores2colours {diffuStats} | R Documentation |
Create a vector of hex colours from numeric values, typically diffusion scores
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
set.seed(1) scores2colours(runif(20))