Skip to content

Facetting fails with "undefined columns selected" error for non-standard variable names #1067

@richierocks

Description

@richierocks

To reproduce:

library(ggplot2)

DF <- data.frame(
  x = 1:10,
  y = runif(10),
  `z z` = gl(5, 2),
  check.names = FALSE
)

ggplot(DF, aes(x, y)) +
  geom_point() +
  facet_wrap(~ `z z`)
## Error in `[.data.frame`(panels, missing_facets) : 
##   undefined columns selected

ggplot(DF, aes(x, y)) +
  geom_point() +
  facet_grid(`z z` ~ .)
## Error in `[.data.frame`(base, names(rows)) : undefined columns selected

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