Description Usage Arguments Value Examples
Alternative to subtracting calls using '-.gg', this method allows one to select the desired components of the available calls and have those evaluated.
1 2 |
x |
A ggghost object to subset |
... |
A logical expression indicating which elements to select. Typically a vector of list numbers, but potentially a vector of logicals or logical expressions. |
Another ggghost object containing only the calls selected.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## 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()
## remove the labels and theme
subset(z, c(1,2,6))
## or
subset(z, c(TRUE,TRUE,FALSE,FALSE,FALSE,TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.