| Type: | Package | 
| Title: | Globe and Mail Graphics Theme for 'ggplot2' | 
| Version: | 0.1.0 | 
| Maintainer: | Tom Cardoso <tcardoso@globeandmail.com> | 
| Description: | Theme and colour palettes for The Globe and Mail's graphics. Includes colour and fill scale functions, colour palette helpers and a Globe-styled 'ggplot2' theme object. | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| Depends: | R (≥ 3.5.0) | 
| Imports: | grDevices, ggplot2 | 
| Language: | en-US | 
| URL: | https://github.com/globeandmail/tgamtheme, https://globeandmail.github.io/tgamtheme/ | 
| BugReports: | https://github.com/globeandmail/tgamtheme/issues | 
| RoxygenNote: | 7.1.1 | 
| Suggests: | testthat (≥ 3.0.0) | 
| Config/testthat/edition: | 3 | 
| NeedsCompilation: | no | 
| Packaged: | 2021-01-29 17:45:50 UTC; tcardoso | 
| Author: | Tom Cardoso [aut, cre] (creator and maintainer) | 
| Repository: | CRAN | 
| Date/Publication: | 2021-02-05 09:40:08 UTC | 
Color scale constructor for The Globe and Mail's colors
Description
Color scale constructor for The Globe and Mail's colors
Usage
scale_color_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...)
scale_colour_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...)
Arguments
| palette | Character name of palette in tgam_palettes. Currently, one of 'main' or 'alternate'. | 
| discrete | Boolean indicating whether color aesthetic is discrete or not | 
| reverse | Boolean indicating whether the palette should be reversed | 
| ... | Additional arguments passed to discrete_scale() or scale_color_gradientn(), used respectively when discrete is TRUE or FALSE | 
Value
A ggplot2 colour scale object, to be passed to a ggplot2 object
Examples
library(ggplot2)
ggplot(diamonds, aes(depth, color = cut)) +
  geom_density() +
  xlim(55, 70) +
  scale_color_tgam()
Fill scale constructor for The Globe and Mail's colors
Description
Fill scale constructor for The Globe and Mail's colors
Usage
scale_fill_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...)
Arguments
| palette | Character name of palette in tgam_palettes. Currently, one of 'main' or 'alternate'. | 
| discrete | Boolean indicating whether color aesthetic is discrete or not | 
| reverse | Boolean indicating whether the palette should be reversed | 
| ... | Additional arguments passed to discrete_scale() or scale_fill_gradientn(), used respectively when discrete is TRUE or FALSE | 
Value
A ggplot2 colour scale object, to be passed to a ggplot2 object
Examples
library(ggplot2)
ggplot(diamonds, aes(carat, fill = cut)) +
  geom_density(position = 'fill') +
  scale_fill_tgam()
Function to extract The Globe and Mail's colors as hex codes
Description
Function to extract The Globe and Mail's colors as hex codes
Usage
tgam_cols(...)
Arguments
| ... | Character names of tgam_colors. Colour names include 'burgundy', 'sky', 'salmon', 'gold', 'gray', 'alt1', 'alt2', 'alt3', 'alt4', 'alt5'. | 
Value
A character vector of one or more colours in The Globe's palette
Examples
tgam_cols()
tgam_cols('burgundy')
Return function to interpolate a Globe and Mail color palette
Description
Return function to interpolate a Globe and Mail color palette
Usage
tgam_pal(palette = "main", reverse = FALSE, ...)
Arguments
| palette | Character name of palette in tgam_palettes. Currently, one of 'main' or 'alternate'. | 
| reverse | Boolean indicating whether the palette should be reversed | 
| ... | Additional arguments to pass to colorRampPalette() | 
Value
A character vector of interpolated colour values
Examples
tgam_pal()(3)
tgam_pal(palette = 'alternate')(3)
ggplot Globe and Mail theme
Description
Theme function to be passed as an argument during ggplot2 charting.
Usage
theme_tgam(
  size = 12,
  family = "GMsanC-Regular",
  title = "GMsanC-Bold",
  position = "center"
)
Arguments
| size | Base font size | 
| family | Font family | 
| title | Font to use for title text | 
| position | How should headings be positioned? Options are 'center' or 'left'. (Default: 'center',) | 
Value
A ggplot2 theme object, to be passed to a ggplot2 object