## 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()
z - "labs" # removes all labs
z - "title" # removes just the title
z - "axis" # removes the axis labels
z - geom_point() # removes points
z - theme_bw() # removes theme_bw()
Run the code above in your browser using DataLab