I have a series of ggplot objects that I'm trying to save to an .rdata file to load into a Markdown document later. The ggplot object itself is quite small (a few KB). But, when I try to save the object as an .rdata file for later retrieval, the resulting .rdata file is now over 8 gigabytes. I've tried saving the plot directly from the GUI, saving as an .rds... Saving as a .pdf or other image results in a normal image of a few KB.
I'm stumped, has anyone else encountered this problem?
Sample workflow below, I can't provide reproducible code for the problem since I can't upload the dataframe required to make this plot
mcmsy<- (ggplot(data = subset(MonteCarlo, Policy == 'RBFM' &
Year == BaselineYear), aes(MSY), alpha = 0.8) + geom_density(fill = 'steelblue2'))
object.size(mcmsy)
save(mcmsy, file = 'mcmsy_plot.rdata')
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…