Package 'paletteer'

Title: Comprehensive Collection of Color Palettes
Description: The choices of color palettes in R can be quite overwhelming with palettes spread over many packages with many different API's. This packages aims to collect all color palettes across the R ecosystem under the same package with a streamlined API.
Authors: See AUTHORS file.
Maintainer: Emil Hvitfeldt <[email protected]>
License: GPL-3
Version: 1.6.0.9000
Built: 2024-09-22 05:02:11 UTC
Source: https://github.com/emilhvitfeldt/paletteer

Help Index


Binned scales to use for ggplot2

Description

These functions provide the option to use binned palettes along with the ggplot2 package. It goes without saying that it requires ggplot2 to work.

Usage

scale_colour_paletteer_binned(palette, direction = 1, ...)

scale_color_paletteer_binned(palette, direction = 1, ...)

scale_fill_paletteer_binned(palette, direction = 1, ...)

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

direction

Either 1 or -1. If -1 the palette will be reversed.

...

Arguments to pass on to ggplot2::scale_colour_stepsn() or ggplot2::scale_fill_stepsn()

Details

Available package/palette combinations are available in the data.frame palettes_c_names.

Value

A ScaleContinuous object that can be added to a ggplot object

Examples

library(ggplot2)
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Petal.Length)) +
  geom_point() +
  scale_colour_paletteer_binned("scico::tokyo")

Continuous scales to use for ggplot2

Description

These functions provide the option to use continuous palettes along with the ggplot2 package. It goes without saying that it requires ggplot2 to work.

Usage

scale_colour_paletteer_c(palette, direction = 1, ...)

scale_color_paletteer_c(palette, direction = 1, ...)

scale_fill_paletteer_c(palette, direction = 1, ...)

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

direction

Either 1 or -1. If -1 the palette will be reversed.

...

Arguments to pass on to ggplot2::scale_colour_gradientn() or ggplot2::scale_fill_gradientn()

Details

Available package/palette combinations are available in the data.frame palettes_c_names.

Value

A ScaleContinuous object that can be added to a ggplot object

Examples

library(ggplot2)
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Petal.Length)) +
  geom_point() +
  scale_colour_paletteer_c("scico::tokyo")

Wrappers around continuous palette functions by package

Description

These functions provide a function wrapper for each package such that a palette can be generated using only the name of the desired palette and the length.

Usage

paletteer_c_ggthemes(name, n)

paletteer_c_grDevices(name, n)

paletteer_c_oompaBase(name, n)

paletteer_c_palr(name, n)

paletteer_c_pals(name, n)

paletteer_c_scico(name, n)

paletteer_c_viridis(name, n)

paletteer_c_harrypotter(name, n)

Arguments

name

Character, name of palette.

n

Integer, number of colors.

Value

Vector of color values from specified palette.


Get continuous palette by package and name

Description

Available package/palette combinations are available in the data.frame palettes_c_names.

Usage

paletteer_c(palette, n, direction = 1)

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

n

Number of colors desired. Must be supplied.

direction

Either 1 or -1. If -1 the palette will be reversed.

Value

A vector of colors.

Examples

paletteer_c("scico::berlin", 100)

Get discrete palette by package and name

Description

Available package/palette combinations are available in the data.frame palettes_d_names.

Usage

paletteer_d(palette, n, direction = 1, type = c("discrete", "continuous"))

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

n

Number of colors desired. If omitted, returns complete palette.

direction

Either 1 or -1. If -1 the palette will be reversed.

type

Either "discrete" or "continuous". Colors are interpolated if "continuous" is picked. Defaults to "discrete".

Value

A vector of colors.

Examples

paletteer_d("nord::frost")
paletteer_d("wesanderson::Royal1", 3)
paletteer_d("Redmonder::dPBIPuOr", 14, type = "continuous")

Get dynamic palette by package and name

Description

Available package/palette combinations are available in the data.frame palettes_dynamic_names.

Usage

paletteer_dynamic(palette, n, direction = 1)

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

n

Number of colors desired. If omitted, returns complete palette.

direction

Either 1 or -1. If -1 the palette will be reversed.

Value

A vector of colors.

Examples

paletteer_dynamic("ggthemes_solarized::green", 8)
paletteer_dynamic("cartography::sand.pal", 20)

Names and version information for all packages included

Description

Names and version information for all packages included

Usage

paletteer_packages

Format

A data.frame with 3 variables:

Names

character, name of package

Github

character, name of Github repository

github_ver

character, version number on Github

CRAN

logical, is package available on CRAN

CRAN_ver

character, version number on CRAN


Names of all continuous palettes

Description

A data.frame of the names and other characteristics of the continuous palettes included in this package.

Usage

palettes_c_names

Format

A data.frame of 319 observations with 3 variables:

package

character, name of package

palette

character, name of palette

type

character, type of palette

Details

Contains palettes names from the following packages: ggthemes, grDevices, harrypotter, oompaBase, palr, pals, scico, viridis.


Complete list of fixed discrete palettes

Description

A list of all the discrete palettes of fixed lengths included in this package. Structured as a list of lists with the first level being each package and the second level being the palettes available in that package.

Usage

palettes_d

Format

A list of 69 lists.

Details

Contains palettes from the following packages: ButterflyColors, DresdenColor, IslamicArt, LaCroixColoR, Manu, MapPalettes, MetBrewer, MexBrewer, MoMAColors, NatParksPalettes, NineteenEightyR, PNWColors, Polychrome, PrettyCols, RColorBrewer, RSkittleBrewer, Redmonder, awtools, basetheme, beyonce, calecopal, colRoz, colorBlindness, colorblindr, dichromat, dutchmasters, feathers, fishualize, futurevisions, ggpomological, ggprism, ggsci, ggthemes, ggthemr, ghibli, grDevices, impressionist.colors, jcolors, khroma, lisa, ltc, miscpalettes, musculusColors, nationalparkcolors, nbapalettes, nord, ochRe, palettesForR, palettetown, pals, peRReo, rcartocolor, rockthemes, rtist, severance, soilpalettes, suffrager, tayloRswift, tidyquant, trekcolors, tvthemes, unikn, vangogh, vapeplot, vapoRwave, waRhol, werpals, wesanderson, yarrr.

data.frame of palette names can be found here palettes_d_names.


Names of all fixed discrete palettes

Description

A data.frame of the names and other characteristics of the discrete palettes of fixed lengths included in this package.

Usage

palettes_d_names

Format

A data.frame of 2415 observations with 4 variables:

package

character, name of package

palette

character, name of palette

length

integer, number of colors in palette

type

character, type of palette

Details

Contains palettes names from the following packages: ButterflyColors, DresdenColor, IslamicArt, LaCroixColoR, Manu, MapPalettes, MetBrewer, MexBrewer, MoMAColors, NatParksPalettes, NineteenEightyR, PNWColors, Polychrome, PrettyCols, RColorBrewer, RSkittleBrewer, Redmonder, awtools, basetheme, beyonce, calecopal, colRoz, colorBlindness, colorblindr, dichromat, dutchmasters, feathers, fishualize, futurevisions, ggpomological, ggprism, ggsci, ggthemes, ggthemr, ghibli, grDevices, impressionist.colors, jcolors, khroma, lisa, ltc, miscpalettes, musculusColors, nationalparkcolors, nbapalettes, nord, ochRe, palettesForR, palettetown, pals, peRReo, rcartocolor, rockthemes, rtist, severance, soilpalettes, suffrager, tayloRswift, tidyquant, trekcolors, tvthemes, unikn, vangogh, vapeplot, vapoRwave, waRhol, werpals, wesanderson, yarrr.

Full list of palette can be found here palettes_d.


Complete list of dynamic palettes

Description

A list of all the dynamic palettes included in this package. Structured as a list of lists with the first level being each package and the second level being the palettes available in that package, and the third level being the palettes for various lengths.

Usage

palettes_dynamic

Format

A list of 3 lists.

Details

Contains palettes from the following packages: cartography and ggthemes.

Full list of palette names can be found here palettes_dynamic_names.


Names of all fixed discrete palettes

Description

A data.frame of the names and other characteristics of the dynamic palettes included in this package.

Usage

palettes_dynamic_names

Format

A data.frame of 25 observations with 4 variables:

package

character, name of package

palette

character, name of palette

length

integer, maximal number of colors in palette

type

character, type of palette

Details

Contains palettes from the following packages: cartography and ggthemes.

Full list of palette can be found here palettes_dynamic.


Discrete scales to use for ggplot2

Description

These functions provide the option to use the discrete and dynamic palettes along with the ggplot2 package. It goes without saying that it requires ggplot2 to work.

Usage

scale_colour_paletteer_d(palette, direction = 1, dynamic = FALSE, ...)

scale_color_paletteer_d(palette, direction = 1, dynamic = FALSE, ...)

scale_fill_paletteer_d(palette, direction = 1, dynamic = FALSE, ...)

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

direction

Either 1 or -1. If -1 the palette will be reversed.

dynamic

toggles between the discrete palettes and the dynamic palettes. Defaults to FALSE which indicates discrete palettes.

...

additional arguments to pass to discrete_scale

Details

Available package/palette combinations are available in the data.frame palettes_d_names and palettes_dynamic_names.

Examples

library(ggplot2)
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) +
  geom_point() +
  scale_colour_paletteer_d("nord::frost")