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

1
2
## S3 method for class 'gg'
e1 + e2

Arguments

e1

An object of class ggghost

e2

A component to add to e1

Value

Appends the e2 call to the ggghost structure

Examples

1
2
3
4
5
6
7
8
9
#' ## 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()