Skip to content

LarsLap/statgl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

statgl

Internal R package of Statistics Greenland. Consists of extensions for ggplot2 themes, with plans to include miscellaneous tools for table output, tools for data wrangling, and API functions for the Statbank

This is a development version; expect things to change.

Installation

The development version of statgl is available on GitHub. To install, run:

# install.packages("devtools")
devtools::install_github("StatisticsGreenland/statgl")

At the moment, this package only has extension functions for ggplot2, providing themes and color palettes that follow the company design manual.

The color functions are made by following this great blog post by Simon Jackson.

Example

Add + theme_statgl() to a ggplot object, to provide a custom theme:

library(ggplot2)
library(statgl)
library(dplyr)

ex_plot <- 
  mpg %>% 
  ggplot(aes(x = displ, y = hwy, color = class)) + 
  geom_point()

ex_plot + theme_statgl()

Add + scale_color_statgl() ot a ggplot object to provide custom color scale:

ex_plot + theme_statgl() + scale_color_statgl()

To provide a fill palette, use + scale_fill_statgl() instead:

ex_plot <- mpg %>% ggplot(aes(x = class, fill = class)) + geom_bar()

ex_plot + theme_statgl() + scale_fill_statgl()

About

Statistics Greenland R-package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • R 91.3%
  • CSS 8.7%