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