This function tries to choose a good plot to show for comparing two variables at a time.
plot_twoway(x, y, xvar, yvar, color = "lightblue", pal = "Set1")
A vector.
A vector of the same length as `x`.
The name of the x variable.
The name of the y variable.
A color to use in the plots that have one single color.
A color palette to use with brewer.pal for the mosaic plots when `x` and `y` are factors.
A plot of `x` versus `y`.
plot_twoway(as.factor(mtcars$gear), mtcars$mpg, xvar = "gear", yvar = "mpg")