Package 'idpalette'

Title: Some palettes for the IDEM, IDDU, and ACEFA research groups
Description: What the package does (one paragraph).
Authors: Gerry Ryan [aut, cre]
Maintainer: Gerry Ryan <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-11-06 02:39:59 UTC
Source: https://github.com/idem-lab/idpalette

Help Index


ACEFA palette

Description

An alias for idpalette(p = "acefa", n, rev)

Usage

acefa(n = NULL, rev = FALSE)

Arguments

n

numeric. How many colours?

rev

logical Reverse the colour order?

Value

idpalette class object of hex colours length n. The idpalette class has a print method that will plot the colours in the object, but it is underneath that a character string of length n and can be otherwise treated as such.

Examples

acefa(5)

IDDU palette

Description

An alias for idpalette(p = "iddu", n, rev)

Usage

iddu(n = NULL, rev = FALSE)

Arguments

n

numeric. How many colours?

rev

logical Reverse the colour order?

Value

idpalette class object of hex colours length n. The idpalette class has a print method that will plot the colours in the object, but it is underneath that a character string of length n and can be otherwise treated as such.

Examples

iddu(5)

IDEM palette

Description

An alias for idpalette(p = "idem", n, rev)

Usage

idem(n = NULL, rev = FALSE)

Arguments

n

numeric. How many colours?

rev

logical Reverse the colour order?

Value

character of length n

idpalette class object of hex colours length n. The idpalette class has a print method that will plot the colours in the object, but it is underneath that a character string of length n and can be otherwise treated as such.

Examples

idem(7)

Base colour palettes for IDEM, IDDU, and ACEFA

Description

Base colour palettes for IDEM, IDDU, and ACEFA

Usage

idpal(p = c("idem", "iddu", "acefa", "acefa_pink", "idem_official"))

Arguments

p

character. Which palette do you want?

Details

"idem", "iddu", and "acefa" return palettes for all colours in logos. "..._official" palettes return only the four-colour palettes per the style- guide from the designer.

NB: These 'non-official' colours are estimated by a colour dropper thing Gerry found on the internet and may or may not be exacty correct.

Value

character of hex values

Examples

idpal("idem")

ID Palette

Description

Create colour palettes based on IDEM, IDDU, and ACEFA colours

Usage

idpalette(p, n = NULL, rev = FALSE)

Arguments

p

character. Which palette? See ?idpal for details.

n

numeric. How many colours?

rev

logical Reverse the colour order?

Value

idpalette class object of hex colours length n. The idpalette class has a print method that will plot the colours in the object, but it is underneath that a character string of length n and can be otherwise treated as such.

Examples

idpalette(
  "idem",
  n = 20,
  rev = TRUE
)

scale ID continuous

Description

Convenience wrapper to ggplot2::continuous_scale to allow use of idpalette or any arbitrary set of colours to be used as a ggplot2 fill or colour scale

Usage

scale_id_continuous(
  cols,
  aesthetics = c("fill", "colour"),
  na.value = "transparent"
)

Arguments

cols

character. A vector of colours

aesthetics

Scale aesthetic.

na.value

Garn - whaddaya want in the NAs?

Value

A ggproto object of class Scale and ScaleContinuous

Examples

library(ggplot2)

ggplot(mtcars) +
  geom_point(
    aes(
      x = disp,
      y = hp,
      colour = qsec
    ),
    size = 5
  ) +
  scale_id_continuous(
    cols = iddu(),
    aesthetics = "colour"
  )