scores2colours: Translate values into colours

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

Create a vector of hex colours from numeric values, typically diffusion scores

Usage

1
2
scores2colours(x, range = c(min(0, min(x)), max(x)), n.colors = 10,
    palette = colorRampPalette(c("#3C5488FF", "white", "#F39B7FFF")))

Arguments

x

numeric vector to be colorised

range

range of values to filter x (values out of the range will be collapsed to the closest limit)

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 colorRampPalette

Value

Character vector with hex colours

Examples

1
2

b2slab/diffuStats documentation built on Oct. 2, 2018, 12:58 p.m.