drop_data | R Documentation |
Drop all data in the plot (only one observation is kept)
drop_data(p)
## S3 method for class 'ggplot'
drop_data(p)
## S3 method for class 'patchwork'
drop_data(p)
## Default S3 method:
drop_data(p)
p |
A |
library(ggplot2)
p <- ggplot(data = mtcars, aes(x = mpg, y = wt, colour = cyl)) +
geom_point() +
scale_x_continuous(limits = c(10, 30)) +
scale_y_continuous(limits = c(1, 6)) +
theme_scp()
object.size(p)
p_drop <- drop_data(p)
object.size(p_drop)
p / p_drop
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.