ggplot2
ggplot2 copied to clipboard
Facets now don't fail if faceting vars are COL, ROW, etc.
This will close #4138.
Works around the issue of duplicated column names by explicitly selecting either data columns or layout columns in the layout data.frame when needed. Added tests that pass.
reprex :)
library(ggplot2)
mtcars$PANEL <- mtcars$cyl
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
facet_grid(cyl ~ am)

ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
facet_grid(PANEL ~ am)

Created on 2021-01-12 by the reprex package (v0.3.0)