colorscale_tokens {tokenbrowser} | R Documentation |
This is a convenience wrapper for tag_tokens() that can be used if tokens only need to be colored.
colorscale_tokens(tokens, value, alpha = 0.4, col_range = c("red", "blue"), span_adjacent = F)
tokens |
A character vector of tokens |
value |
A numeric vector with values between -1 and 1. Determines the color mixture of the scale colors specified in col_range |
alpha |
Optionally, the alpha (transparency) can be specified, with 0 being fully transparent and 1 being fully colored. This can be a vector to specify a different alpha for each value. |
col_range |
The colors used in the scale ramp. |
span_adjacent |
If TRUE, include adjacent tokens with identical attributes within the same tag |
a character vector of color-tagged tokens
colorscale_tokens(c('token_1','token_2','token_3'), value = c(-1,0,1))