Description Usage Arguments Author(s) See Also Examples
Create bar plot of proportions of data with counts superimposed over the bars. Plots the proportions of each level of y per level of x.
1 2 3 4 5 |
data |
a dataframe |
x |
Unquoted variable name. The column in |
y |
Unquoted variable name. The column in |
facet |
character vector containing name(s) of one or two additional factors in |
percent |
logical. Should y axis display percentages (rather than proportions)? |
facet.cols |
numeric. Number of columns in display of faceted plots. |
scales |
character vector specifying whether scales should be fixed across facets. Values are |
width |
numeric. Width of bars in plots. |
size |
numeric. Size of text for counts. |
opp.cols |
logical. Should colors of counts be different (white and black)? Intended for use with darker colors in bars. |
... |
additional options. |
Jason Grafmiller
See Also ggplot2, geom_bar
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(brown_genitives)
## plot the percentages of s- vs. of-genitives by genre
ggBar.plot(brown_genitives, Genre, Type)
## plot the percentages of s- vs. of-genitives by
## genre and possessor animacy
ggBar.plot(brown_genitives, Genre, Type,
facet = "PossrAnimacyBin")
## plot the percentages of s- vs. of-genitives by
## genre, possessor animacy and possessum animacy
ggBar.plot(brown_genitives, Genre, Type,
facet = c("PossrAnimacyBin", "PossmAnimacyBin")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.