Learn R Programming

ggthemr (version 1.1.0)

ggthemr: Style ggplot2

Description

ggthemr provides colour schemes and layouts for ggplot2.

Set theme to be applied to all subsequent ggplots.

Usage

ggthemr(palette = "dust", layout = "clear", spacing = 1.6,
  text_size = 12, type = "inner", line_weight = 0.5, pos = 1,
  envir = as.environment(pos), set_theme = TRUE)

Arguments

palette

Colour scheme by name or ggtheme object.

layout

The layout of gridlines, axes etc.

spacing

A numeric value of how much space should exist on any given plot. Low values will result in more cramped plots, higher values will have more whitespace.

text_size

base text size.

type

Set to 'inner' where the background colour should not extend past strictly the plot area (or "panel" in ggplot2 terminology). 'outer' will apply the background colour to the entire plot.

line_weight

The thickness of axes lines and gridlines. Useful for saving plots at different resolutions.

pos

Where the new scales are stored.

envir

The environment where the new scales are stored.

set_theme

If TRUE (default), the default theme, geoms and scales are updated.

Value

Returns a list with a ggplot2 theme object, aesthetic parameters for geoms, scale functions and input parameters

Examples

Run this code
# NOT RUN {
 ggthemr('pale', layout = 'scientific', spacing = 2, type = 'inner')
# }

Run the code above in your browser using DataLab