Skip to content

labs should ignore trailing comma #4237

Closed

Description

@bersbersbers

Many ggplot2 functions accept (that is, ignore) a trailing comma. A few don't, such as ggplot::labs:

df <- data.frame()
ggplot2::ggplot(
    df,
    ggplot2::aes(
        x = x,
        y = y, # trailing comma
    ), # trailing comma
) +
    ggplot2::labs(
        x = "x",
        y = "y", # no trailing comma allowed. Error: Argument 3 is empty
    ) +
    ggplot2::theme(
        , # trailing comma
    )

Activity

  1. bersbersbers commented on Oct 14, 2020

    @bersbersbers
    ContributorAuthor

    Also, ggplot2::guides.

  2. yutannihilation commented on Oct 15, 2020

    @yutannihilation
    Member

    Thanks for reporting. I'm not sure if we need consistency here, but these two seems easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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