bargraph | R Documentation |
Create a bargraph of a categorical variable.
bargraph(x, data, horizontal = FALSE, type = "frequency", col = NULL, ...)
x |
Formula. An expression of the form |
data |
Data frame. The data where the variables can be found. |
horizontal |
Logical. Use |
type |
Character. Choose the type of y-axis. Options include |
groups |
Factor. An additional variable to use for side-by-side bargraphs. |
For additional options for creating bargraphs, look at the
help file found in the mosaic
package or run help(bargraph,
package="mosaic")
in the console.
data(cdc)
bargraph(~depressed, data = cdc)
bargraph(~depressed, data = cdc, groups = gender)
bargraph(~depressed | grade, data = cdc, groups = gender)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.