slim_data: Drop unused data from the plot to reduce the object size

View source: R/SCP-plot.R

slim_dataR Documentation

Drop unused data from the plot to reduce the object size

Description

Drop unused data from the plot to reduce the object size

Usage

slim_data(p)

## S3 method for class 'ggplot'
slim_data(p)

## S3 method for class 'patchwork'
slim_data(p)

Arguments

p

A patchwork object.

Examples

library(ggplot2)
p <- ggplot(data = mtcars, aes(x = mpg, y = wt, colour = cyl)) +
  geom_point()
object.size(p)
colnames(p$data)

p_slim <- slim_data(p)
object.size(p_slim)
colnames(p_slim$data)


zh542370159/SCP documentation built on Nov. 22, 2023, 2:34 a.m.