Scale Functions for Visualization
Overview
Graphical scales map data to aesthetics, and provide methods for automatically determining breaks and labels for axes and legends.
- Range training now supports custom classes. Continuous classes require a
range()method that returns numeric values. Discrete classes require alevels()method (and optionally adroplevels()method) (#480). - New
label_glue()labelling function for interpolated strings (#457). fullseq()and by extensionbreaks_width()can now deal with unsorted ranges (#435).- New
label_date_short(leading)argument to replace leading zeroes (#442) breaks_pretty()will return the input limit when it has no range (#446)breaks_exp()now provides more sensible breaks for the exponential transformtransform_exp()now has more sensible breaks, available inbreaks_exp()(@teunbrand, #405).- The scales package now keeps track of known palettes. These can be retrieved using
get_palette()or registered usingset_palette()(#396).
Show all changes in 1.4.0Hide the rest of the changes in 1.4.0
label_log()has asignedargument for displaying negative numbers (@teunbrand, #421).- New
label_dictionary()for named lookup of labels (#458). - New function
compose_label()to chain together label formatting functions (#462) - Palette function now have classes, attributes and coercion methods (@teunbrand, #426).
- Added colour manipulation functions:
col_shift(),col_saturate(),col_darker(),col_lighter()andcol_mix()(@teunbrand, #423) label_date_short()gainstzandlocaleargument (#478)
From NEWS.md in the release
Install
Health
NOTEDESCRIPTION meta-informationr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Author field differs from that derived from Authors@R Author: ‘Hadley Wickham [aut], Thomas Lin Pedersen [cre, aut] (<https://orcid.org/0000-0002-5147-4711>), Dana Seidel [aut], Posit Software, PBC [cph, fnd] (03wc8by49)’ Authors@R: ‘Hadley Wickham [aut], Thomas Lin Pedersen [cre, aut] (ORCID: <https://orcid.org/0000-0002-5147-4711>), Dana Seidel [aut], Posit Software, PBC [cph, fnd] (ROR: <https://ror.org/03wc8by49>)’
- NOTE11 OK, 2 NOTE2026-06-09
- WARNING11 OK, 1 NOTE, 1 WARNING2026-06-08
- ERROR11 OK, 1 NOTE, 1 ERROR2026-06-07
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
The repository also keeps web-only articles.
- Help pages
- 101 (26 internal)includes a package overview page
- Examples that run
- 100%69 run in a plain check (2 of them under a condition)
- Exported functions with examples
- 70%
- Documented parameters
- 93%
- Return-value docs
- 33%
- Help pages citing references
- 5%
Downloads
Repository
- PRs merged (all time)
- 81%
- Median days to close, 50 most recently updated closed issues
- 135
- Median days to close, 50 most recently updated closed PRs
- 18
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
15 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/r-lib/scales on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-06 · The repository has a site deploy workflow
pkgdown site last built 2025-04-24
Show all practicesHide 2 practices
Dependencies
Installing scales adds 9 packages (4 with compiled code, 4.1 MB of source tarballs). Heaviest: farver 1.2 MB, viridisLite 1.2 MB, rlang 766 KB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 1,012 more dependents and 445 packages that suggest it on CRAN ↗
Code & Tests
People & History
Previously maintained by Hadley Wickham (0.1.0 to 1.2.1).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- RR 3.0.0 released · 2013-04-03
- 2.15.3Latest
- 2.15.22012-09-03 · diff ↗
Show 24 earlier eventsHide 24 earlier events
- 2.15.12012-05-08 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 2.14.22012-02-27 · diff ↗
- RR 2.14.0 released · 2011-10-31
- 2.13.22011-09-19 · diff ↗ ·
added 70 exports
alpha, area_pal, as.trans, asn_trans, atanh_trans, boxcox_trans, brewer_pal, cbreaks, censor, col2hcl, comma_format, comma, ContinuousRange, cscale, date_breaks, date_format, date_trans, dichromat_pal, discard, DiscreteRange, div_gradient_pal, dollar_format, dollar, dscale, exp_trans, expand_range, format_format, fullseq, gradient_n_pal, grey_pal and 40 more - 1.4.02025-04-24 · diff ↗ ·
added 24 exports
as_continuous_pal, as_discrete_pal, breaks_exp, col_darker, col_lighter, col_mix, col_saturate, col_shift, compose_label, format_log, is_colour_pal, is_continuous_pal, is_discrete_pal, is_numeric_pal, is_pal, label_dictionary, label_glue, minor_breaks_log, new_continuous_palette, new_discrete_palette, number_options, palette_na_safe, palette_nlevels, palette_type - 1.3.02023-11-28 · diff ↗ ·
added 49 exports
as.transform, asinh_trans, breaks_timespan, cut_time_scale, demo_timespan, is.transform, label_currency, label_timespan, new_transform, pal_area, pal_brewer, pal_dichromat, pal_div_gradient, pal_gradient_n, pal_grey, pal_hue, pal_identity, pal_linetype, pal_manual, pal_rescale, pal_seq_gradient, pal_shape, pal_viridis, timespan_trans, transform_asinh, transform_asn, transform_atanh, transform_boxcox, transform_compose, transform_date and 19 more - 1.2.12022-08-20 · diff ↗
- 1.2.02022-04-14 · diff ↗ ·
added 5 exports
compose_trans, cut_long_scale, cut_short_scale, cut_si, label_log - 1.1.12020-05-12 · diff ↗ ·
added 8 exports
demo_time, oob_censor, oob_censor_any, oob_discard, oob_keep, oob_squish, oob_squish_any, oob_squish_infinite - 1.1.02019-11-18 · diff ↗ ·
added 28 exports
Range, breaks_extended, breaks_log, breaks_pretty, breaks_width, demo_continuous, demo_datetime, demo_discrete, demo_log10, label_bytes, label_comma, label_date, label_date_short, label_dollar, label_math, label_number, label_number_auto, label_number_si, label_ordinal, label_parse, label_percent, label_pvalue, label_scientific, label_time, label_wrap, minor_breaks_n, minor_breaks_width, yj_trans - 1.0.02018-08-09 · diff ↗ ·
added 12 exports
modulus_trans, number, number_bytes, number_bytes_format, number_format, ordinal_english, ordinal_french, ordinal_spanish, pseudo_log_trans, pvalue, pvalue_format, time_format - 0.5.0
- 0.4.1
- 0.4.02016-02-26 · diff ↗
- 0.3.0
- 0.2.52015-06-12 · diff ↗ ·
added 9 exports
col_bin, col_factor, col_numeric, col_quantile, colour_ramp, ordinal, ordinal_format, unit_format, wrap_format - 0.2.42014-04-22 · diff ↗
- 0.2.32012-12-05 · diff ↗
- 0.2.22012-09-04 · diff ↗
- 0.2.1
- 0.2.02012-02-27 · diff ↗
- 0.1.02011-09-22
- RR 2.13.0 released · 2011-04-13
Package metadata
- First published
- 2011-09-19
- Total releases
- 23 / 15 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1
- Download size
- 321 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("scales")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.