Colour Palettes for Data
Overview
Colour palettes for data, based on some well known public data sets. Includes helper functions to map absolute values to known palettes, and capture the work of image colour mapping as raster data sets.
- Fixed a long-standing bug in
sst_pal(),chl_pal(),ice_pal(), andbathy_deep_pal(): data values below the first palette break were silently dropped from the output (a zero index fromfindInterval()), shortening the result and misaligning colours. Out of range values now clamp to the end colours and output length always matches input length. - The absolute palettes now share one internal worker
abs_pal(), unifying alpha handling and the n-colours/data/palette/function modes. The function mode (pal()) now respectsalpha. - New function
image_hex()converts matrices and arrays (1-band palette, grey+alpha, RGB, RGBA, raw, logical, character) to a matrix of hex colours. This is the colour engine shared with the {ximage} package, with robust handling of missing, non-finite, and constant data.
Show all changes in 0.5.0Hide the rest of the changes in 0.5.0
- New stretch functions
stretch_linear(),stretch_log(),stretch_sqrt(), andstretch_histeq()rescale data to [0, 1] ahead of colour mapping, based on experience with Sentinel-2. They preserve matrix/array dimensions, map constant input to 0.5, return NA for non-finite input, and accept absolute bounds vialimfor scene-independent stretches. - New function
dirty_pal()for global bathymetry/topography (AAD underway, DiRT). Follows the standard palr palette modes. d_pal()andimage_pal()now map constant data to a mid-palette colour instead of returning NA.- Tests moved to testthat edition 3, fixed a test that used the magrittr pipe without it being available.
- Removed unused Suggests of viridis, removed large blocks of commented-out legacy code.
- Fixed deprecated usage of
structure()thanks to CRAN.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-12
- NOTE11 OK, 2 NOTE2026-07-16
- OK14 OK2026-03-10
Documentation
- Help pages
- 13includes a package overview page
- Examples that run
- 92%11 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 100%
- Documented parameters
- 97%
- Return-value docs
- 100%
- Help pages citing references
- 38%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 2
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
Issues over time
Commits over time
10 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/australianantarcticdivision/palr 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-08-05 · The repository has a site deploy workflow
pkgdown site last built 2026-08-05
Show all practicesHide 1 practice
Dependencies
Installing palr adds no packages beyond those that come with R.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.5.0Latest2026-08-05 · current release · diff ↗ ·
added 6 exports
dirty_pal, image_hex, stretch_histeq, stretch_linear, stretch_log, stretch_sqrt - RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 0.4.02023-11-06 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.3.0
- RR 4.0.0 released · 2020-04-24
- 0.2.02020-01-30 · diff ↗
- 0.1.02019-11-07 · diff ↗ ·
added 7 exports
bathy_deep_pal, chl_pal, ice_pal, image_pal, image_raster, image_stars, sst_pal - RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- 0.0.6
Show 3 earlier eventsHide 3 earlier events
- RR 3.3.0 released · 2016-05-03
- 0.0-42015-06-11
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-06-11
- Total releases
- 7 / 11 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.6.0
- Bundled data
- 46 KB / 2 files
- Download size
- 236 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("palr")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-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.