Skip to content

A package to allow ggplot2 or lattice graphics to be "tagged" with meta information

License

Notifications You must be signed in to change notification settings

andyofsmeg/ggTag

Repository files navigation

ggTag

Tag ggplot2 graphics with standard meta-information

Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Travis-CI Build Status CRAN RStudio mirror downloads

Overview

The primary ggTag function embeds a ggplot object within a grid framework. The function allows a user to add titles and meta information to the outer border of a plot along with file path and date-time stamps (which are automatically added upon execution). An existing ggplot title can be moved from the original graphic to the outer framework.

Installation

devtools::install_github("andyofsmeg/ggTag")

Usage

The main package function ggTag can simply take a ggplot2 object and will automatically add the appropriate meta-information. Additional information can be supplied as arguments to the function.

library(ggplot2)
library(ggTag)

my_scat <- qplot(Temp, Wind, data = airquality, main = "Less Windy when Warm")
# Let's have a look at this summary of 45 year old airquality data
my_scat 

# Now let's tag it
library(ggTag)
ggTag(my_scat, 
      meta = list(top_left = "Analysis ID 123456", top_right = "Page 1 of 1"),
      extractTitle = TRUE)

# Pretend it's pharmaceutical data
pharmaTag(my_scat, protocol = "GSK123456", population = "ITT", 
          page = 1, pages = 2,
          extractTitle = TRUE) 

About

A package to allow ggplot2 or lattice graphics to be "tagged" with meta information

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages