vec_pal_colours: vec_pal_colours

Description Usage Arguments Details Value

View source: R/vec_pal_colours.R

Description

Create colour scale and indexes for vector

Usage

1
vec_pal_colours(vec, palette_fn, n_cols, zero_index = FALSE)

Arguments

vec

a numeric of vector of values to generate palette indexes for

palette_fn

a function that will produce a vector of integer colour code strings, when called: 'palette_fn(n_cols)'

n_cols

the number of colours to generate using the 'palette_fn'.

zero_index

should the colour indexes begin at 0, for use with 0 indexed languages like Javascript?

Details

Given a vector of numeric values, return a palette of size 'n_cols“ and a set of indexes into the palette of size equal to the numeric vector.

Value

A list contain two named vectors: 'colours' and 'indexes'.


MilesMcBain/r2vr.gis documentation built on May 24, 2019, 7:52 a.m.