Colour Palettes for Data

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.


CRANstatus R-CMD-check

palr

palr provides colour palettes for data, based on some well known remotely sensed data sets for sea ice concentration, sea surface temperature and chlorophyll-a. It includes function image_pal() to create the data used by the image() function as colours.

There are five main ways of working with palr palette functions, which have names like ice_pal(), chl_pal() and sst_pal() for ice, chlorophyll-a and sst respectively and mk_timePal for creating a time-mapped palette function.

  • ice_pal(n) return n colours from the palette
  • ice_pal(data) return the right colour for values in data
  • ice_pal(palette = TRUE) returns the entire palette, with colours cols and intervals breaks
  • tfun <- mk_timePal(datetimes, pal); plot(x, tfun(dt)) match date-times to a palette, or palette function.
  • image_pal(data, col = colors, breaks = breaks) emulates the behaviour of image() but return colours as data rather than draw a plot
  • d_pal(data) returns a colour for a set of values

See the website for documentation: https://australianantarcticdivision.github.io/palr/

Installation

Install the current release from CRAN using

install.packages("palr")

To install the development version:

library(devtools)
install_github("AustralianAntarcticDivision/palr")

Please note that the palr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("palr")

0.5.0 by Michael D. Sumner, 2 months ago


https://australianantarcticdivision.github.io/palr/, https://github.com/AustralianAntarcticDivision/palr


Report a bug at https://github.com/AustralianAntarcticDivision/palr/issues


Browse source code at https://github.com/cran/palr


Authors: Michael D. Sumner [aut, cre, cph] , Abigael Proctor [ctb] (Named the package) , Tomas Remenyi [ctb] (Provided colours for element_pal) , R Core Team and contributors worldwide [ctb] (source code of image.default)


Documentation:   PDF Manual  


GPL-3 license


Imports grDevices

Suggests knitr, rmarkdown, raster, testthat, covr, stars


Imported by quadmesh.

Suggested by inDAGO, paletteer.


See at CRAN