ct_ggplot: ggconventions wrappers around ggplot

Description Usage Arguments Examples

View source: R/ggconventions.r

Description

ct_ggplot ("conventions transform ggplot"), cf_ggplot ("conventions fortify ggplot"), provide wrappers which takes a data frame and applies c_transform and then the appropriate plot function

Usage

1
2
3
4
5
ct_ggplot(data, ..., variables = getOption("conventions", NULL),
  fortify_data = FALSE, prefix = "c.")

cf_ggplot(data, ..., variables = getOption("conventions", NULL),
  prefix = "c.")

Arguments

data

Data frame passed to c_transform and then transformed data frame to ggplot

...

Passed to ggplot

variables

Passed to c_transform

fortify_data

Passed to c_transform, set to TRUE for cf_ggplot

prefix

Passed to c_transform

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require("ggplot2")
source(system.file("conventions/gender.R", package="ggconventions"))
data("gender_data", package="ggconventions")
ct_ggplot(gender_data, 
    aes(x=class, y=survivors, colour=gender, shape=gender)) +
    geom_point(size=7) + ggtitle("# adult survivors of Titanic")
source(system.file("conventions/redblack.R", package="ggconventions"))
data("profit_data", package="ggconventions")
cf_ggplot(profit_data, aes(x=Index, y=profit, 
       colour=c.profit, fill=c.profit)) + geom_bar(stat='identity')

trevorld/ggconventions documentation built on May 25, 2019, 9:25 a.m.