Skip to content

Facet_grid with empty "data=" in a second geom: empty(data) returns NA and error message is wrong #3853

Closed
@alex-l-m

Description

@alex-l-m

Someone puts a second facet in a facet_grid, but forgets to add a data argument:

ggplot() + geom_point(aes(x=Sepal.Width, y=Sepal.Length), data=iris) +
  geom_line(aes(x = whatever, y=whatever)) + 
  facet_grid(rows=vars(Species))

Should say something like "whatever not found", but instead you get "Error in if (empty(data)) { : missing value where TRUE/FALSE needed".

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