Description Usage Arguments Value Examples
Create a two choice horizontal stacked bar chart in the style of base graphics. Default color scheme makes it easy to throw into slides and posters as an infographic style plot.
1 2 3 |
n.yes |
Number yes (integer). User must supply 2 of the first three
parameters ( |
n.no |
Number no (integer). |
n |
Total number (integer). |
labs |
The labels to use for the two choices that correspond to
|
digits |
Digits to use in the percents. |
fill |
The bar fill colors |
color |
The text color. |
border |
The border color. |
size |
The text size. |
include.percent |
A logical vector of 1-2 (if 1 the second will be
|
Returns a ggplot
object.
1 2 3 4 5 6 7 8 9 | yes_no_bar(111, 66)
yes_no_bar(111, 66, fill=c("pink", "ivory"), color="purple")
yes_no_bar(55, n = 166, labs = c("True", "False"))
yes_no_bar(2345, 3456, labs = c("Boy", "Girl"), fill=c("lightblue", "pink"),
color="grey50", include.percent = TRUE)
yes_no_bar(2345, 3456, labs = c("Boy", "Girl"), fill=c("lightblue", "pink"),
color="grey50", include.percent = FALSE)
yes_no_bar(9999, n = 22166, fill=c("green", "pink"),
labs = c("Go:", "Stop"), color = "grey30", digits=0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.