GG_contingency_table | R Documentation |
Makes a pretty contingency table with ggplot2 using geom_tile.
GG_contingency_table(data, var1, var2, margin = NULL)
data |
(data.frame) The data. |
var1 |
(chr scalar) The name of the first variable (vertical) |
var2 |
(chr scalar) The name of the second variable (horizontal) |
margin |
(NULL, 1, 2) Which margin to use. Default = NULL. |
GG_contingency_table(mpg, "drv", "cyl")
GG_contingency_table(mpg, "drv", "cyl", margin = 1)
GG_contingency_table(mpg, "drv", "cyl", margin = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.