Skip to content

Saving ggplots objects as .RDS or .RData no longer works with 4.0.0 #6637

@LangeTo

Description

@LangeTo

Hey all together,

I figured that the latest ggplot release breaks my workflows, although I'm not sure what I do is intended or a _hack_🙈.

So, my idea was to have a bunch of .R files in my directory, which handle data wrangling and plotting. The plots were then save as .RDS or .RData files and in my report.qmd I would call the plots using either load() or readRDS(). They would then be available as ggplot objects and I could still add new layers to tailor the plot for the next presentation.

However, after upgrading to ggplot 4.0.0, all I get is:

$data
...
$layers
...
$scales
...
...

Could this be related to this change?

ggsave() now returns the saved file location invisibly (#3379, @eliocamp). Note that, as a side effect, an unofficial hack + ggsave() no longer works (#4513).

As I said, I'm not sure if my workflow is actually intended but it turned out to be very helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions