Learn R Programming

ggghost (version 0.2.3)

+.gg: Add a New ggplot Component to a ggghost Object

Description

This operator allows you to add objects to a ggghost object in the style of @hrbrmstr.

Usage

# S3 method for gg
+(e1, e2)

Value

Appends the e2 call to the ggghost structure

Arguments

e1

An object of class ggghost

e2

A component to add to e1

Examples

Run this code
#' ## create a ggghost object
tmpdata <- data.frame(x = 1:100, y = rnorm(100))

z %g<% ggplot(tmpdata, aes(x,y))
z <- z + geom_point(col = "steelblue")
z <- z + theme_bw()
z <- z + labs(title = "My cool ggplot")
z <- z + labs(x = "x axis", y = "y axis")
z <- z + geom_smooth()

Run the code above in your browser using DataLab