plot_twoway | R Documentation |
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")
x |
A vector. |
y |
A vector of the same length as 'x'. |
xvar |
The name of the x variable. |
yvar |
The name of the y variable. |
color |
A color to use in the plots that have one single color. |
pal |
A color palette to use with brewer.pal for the mosaic plots when 'x' and 'y' are factors. |
A plot of 'x' versus 'y'.
Leonardo Collado-Torres
plot_twoway(as.factor(mtcars$gear), mtcars$mpg, xvar = "gear", yvar = "mpg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.