Package 'circadia'

Title: Circadia Lab Colour Palettes and ggplot2 Theme
Description: Provides the shared visual identity for the Circadia Lab R ecosystem: colour palettes, ggplot2 theme, and ggplot2 scales. Palettes cover qualitative, sequential, and diverging use cases anchored on the lab's brand colours. Designed to be used alongside zeitR, slumbR, tallieR, and syncR.
Authors: Lucas França [aut, cre] (ORCID: <https://orcid.org/0000-0003-0853-1319>), Mario Leocadio-Miguel [aut] (ORCID: <https://orcid.org/0000-0002-7248-3529>)
Maintainer: Lucas França <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-07-01 23:57:00 UTC
Source: https://github.com/circadia-bio/circadia

Help Index


Retrieve a Circadia Lab palette

Description

Returns a named character vector of hex colour codes for the requested palette. Suitable for direct use in ggplot2::scale_fill_manual() or ggplot2::scale_colour_manual().

Usage

circadia_palette(palette = "main", n = NULL, reverse = FALSE)

Arguments

palette

Name of the palette. One of "main", "core", "diverging", "diverging_simple", "blues", "warm", "seq_blue", "seq_coral", "seq_amber", "seq_ochre". Defaults to "main".

n

Number of colours to return. If NULL (default) all colours in the palette are returned. If n is smaller than the palette length the first n colours are returned; if larger an error is thrown.

reverse

Logical. Reverse the order of the palette? Default FALSE.

Details

Gradient palettes come in two families:

  • Complex (multi-hue): "diverging", "blues", "warm"

  • Simple (monochromatic / direct interpolation): "diverging_simple", "seq_blue", "seq_coral", "seq_amber", "seq_ochre"

Value

A named (or unnamed for gradient palettes) character vector of hex colour codes.

Examples

circadia_palette()
circadia_palette("core")
circadia_palette("diverging_simple")
circadia_palette("seq_blue", n = 3)
circadia_palette("diverging", reverse = TRUE)

List all available Circadia Lab palettes

Description

Prints the names and sizes of all palettes defined in the package.

Usage

circadia_palettes()

Value

A named integer vector of palette lengths, invisibly.

Examples

circadia_palettes()

Return the brand colour for a Circadia Lab data domain

Description

Looks up the hex colour associated with a named data domain. Useful when you want to colour-code panels or annotations by data type rather than by group membership.

Usage

domain_colour_for(domain)

Arguments

domain

Character scalar. One of "actigraphy", "sleep", "circadian", "questionnaire", "demographics", "clinical", "light", "activity".

Value

A length-1 named character vector with the domain hex colour, e.g. c(actigraphy = "#014370").

Examples

domain_colour_for("sleep")
domain_colour_for("light")
domain_colour_for("activity")

Circadia Lab discrete colour scale

Description

Applies a Circadia Lab qualitative palette to the colour aesthetic.

Usage

scale_colour_circadia(palette = "main", reverse = FALSE, ...)

scale_color_circadia(palette = "main", reverse = FALSE, ...)

Arguments

palette

Palette name. Default "main".

reverse

Logical. Reverse the palette? Default FALSE.

...

Additional arguments passed to ggplot2::discrete_scale().

Examples

library(ggplot2)
ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) +
  geom_point(size = 3) +
  scale_colour_circadia() +
  theme_circadia()

Circadia Lab continuous colour scale

Description

Interpolates across a Circadia Lab palette for continuous colour data. The "diverging" palette is recommended for data centred at zero; "blues" or "warm" for unipolar data.

Usage

scale_colour_circadia_c(palette = "blues", reverse = FALSE, ...)

scale_color_circadia_c(palette = "blues", reverse = FALSE, ...)

Arguments

palette

Palette name. Default "blues".

reverse

Logical. Reverse the palette? Default FALSE.

...

Additional arguments passed to ggplot2::scale_colour_gradientn().

Examples

library(ggplot2)
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
  geom_tile() +
  scale_fill_circadia_c("warm") +
  theme_circadia()

Circadia Lab discrete fill scale

Description

Applies a Circadia Lab qualitative palette to the fill aesthetic.

Usage

scale_fill_circadia(palette = "main", reverse = FALSE, ...)

Arguments

palette

Palette name. Default "main".

reverse

Logical. Reverse the palette? Default FALSE.

...

Additional arguments passed to ggplot2::discrete_scale().

Examples

library(ggplot2)
ggplot(mpg, aes(class, fill = drv)) +
  geom_bar() +
  scale_fill_circadia() +
  theme_circadia()

Circadia Lab continuous fill scale

Description

Interpolates across a Circadia Lab palette for continuous fill data.

Usage

scale_fill_circadia_c(palette = "blues", reverse = FALSE, ...)

Arguments

palette

Palette name. Default "blues".

reverse

Logical. Reverse the palette? Default FALSE.

...

Additional arguments passed to ggplot2::scale_colour_gradientn().


Circadia Lab ggplot2 theme

Description

A clean, minimal ggplot2 theme built on ggplot2::theme_minimal() with typography and spacing consistent with Circadia Lab figures.

Usage

theme_circadia(
  base_size = 12,
  base_family = "",
  grid = "xy",
  legend_position = "right"
)

Arguments

base_size

Base font size in points. Default 12.

base_family

Base font family. Default "" (ggplot2 default).

grid

Which grid lines to show. One of "xy" (both, default), "x" (vertical only), "y" (horizontal only), "none".

legend_position

Position of the legend passed to ggplot2::theme(). Default "right".

Value

A ggplot2::theme() object.

Examples

library(ggplot2)
ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) +
  geom_point(size = 2) +
  scale_colour_circadia() +
  theme_circadia()