Skip to content

bug: Class meta field should be expanded when converting ggplot class to a list #6518

Open
@schloerke

Description

@schloerke

Lines:

ggplot2/R/plot.R

Lines 278 to 285 in a2d0181

#' @importFrom S7 convert
S7::method(convert, list(from = class_ggplot, to = S7::class_list)) <-
function(from, to) {
S7::props(from)
}
S7::method(as.list, class_ggplot) <- function(x, ...) convert(x, S7::class_list)
rm(`as.list`)

Reprex:

p <- ggplot(mpg, aes(cty, hwy)) + geom_point()
p$barret <- "Hello"
as.list(p)

Expecting: `list(..., barret = "Hello")

Received: list(..., meta = list(barret = "Hello"))

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions