Using the Auto MPG data set as an example, I'd like to create plots showing the relationship between hwy milage ~ year, ~ displacement, ~ cyl. Can you do this using a facet grid where the rows are manufacturer and the cols = c(year, displacement, and cyl)?
I've only been able to do this in three individual plots so far and would like to combine into one plot.
ggplot(mpg, aes(year, hwy)) +
geom_smooth(method = "lm", se = FALSE)+
facet_grid(rows = vars(manufacturer))
ggplot(mpg, aes(displ, hwy)) +
geom_smooth(method = "lm", se = FALSE)+
facet_grid(rows = vars(manufacturer))
ggplot(mpg, aes(cyl, hwy)) +
geom_smooth(method = "lm", se = FALSE)+
facet_grid(rows = vars(manufacturer))
