Skip to content

facets fail with uninformative error for some column namesΒ #4138

@eliocamp

Description

@eliocamp

If one tries to facet a plot using columns with name "COL", "ROW", "PANEL", "SCALE_X" or "SCALE_Y", ggplot2 fails with a rather obscure error.

library(ggplot2)

mtcars$ROW <- mtcars$cyl
ggplot(mtcars, aes(hp, mpg)) +
   geom_point() +
   facet_grid(ROW ~  am) 
#> Error: `scale_id` must not be `NA`

Created on 2020-07-17 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorfacets πŸ’Ž

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions