Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dscale

Discrete scale


Description

Discrete scale

Usage

dscale(x, palette, na.value = NA)

Arguments

x

vector of discrete values to scale

palette

aesthetic palette to use

na.value

aesthetic to use for missing values

Examples

with(mtcars, plot(disp, mpg, pch = 20, cex = 3,
  col = dscale(factor(cyl), brewer_pal())))

scales

Scale Functions for Visualization

v1.1.1
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], Dana Seidel [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.