ggplot2-book icon indicating copy to clipboard operation
ggplot2-book copied to clipboard

facet chapter still uses the classic formula-based interface

Open djnavarro opened this issue 2 years ago • 3 comments

need to switch from facet_grid(a ~ b) to facet_grid(rows = vars(a), cols = vars(b)) etc

djnavarro avatar Jan 23 '23 04:01 djnavarro

FWIW I think we're rather lukewarm on the new syntax, so I wouldn't go out of my way to switch to it.

hadley avatar Jan 23 '23 13:01 hadley

Noted 😁

I actually don't mind the new syntax. It is clunky in some ways, but I feel that's a consequence of vars()? The two-sided formula version was always a headache for me: I never had a good way of remembering whether LHS maps to rows or columns. But point taken... there are higher priorities!

djnavarro avatar Feb 03 '23 03:02 djnavarro

I think if we were to do this again it would be facet_grid(rows = a, cols = b), but we can't easily back out of the vars() syntax 😬

hadley avatar Feb 03 '23 18:02 hadley