Description Usage Arguments Value Examples
Plot the counts of groups within a vector or list as a horizontal bar plot.
1 2 3 4 5 6 7 8 9 |
x |
A vector or list of elements. |
direct.label |
logical. If |
size |
The size to plot the text above the bars. |
label.diff |
The amount to place the labels above the bars. If
|
digits |
The number of percent digits to print. |
top.diff.weight |
A weight to apply to the space between the top bar and the top of the plot area. |
... |
Other arguments passed to |
ggplot2 object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | x <- sample(LETTERS, 100, TRUE)
y <- lapply(1:100, function(i) sample(LETTERS[1:10], sample(0:5, 1), TRUE))
y <- sapply(y, function(x) {
if(identical(x, character(0))) return(NULL)
x
})
plot_freq(x)
plot_freq(y)
## Example
library(dplyr)
data(presidential_debates_2012)
discoure_markers <- list(
response_cries = c("\\boh", "\\bah", "\\baha", "\\bouch", "yuk"),
back_channels = c("uh[- ]huh", "uhuh", "yeah"),
summons = "hey",
justification = "because"
)
presidential_debates_2012 %>%
with(., term_count(dialogue, TRUE, discoure_markers)) %>%
as_terms() %>%
plot_freq(size=3) +
ggplot2::xlab("Number of Tags")
presidential_debates_2012 %>%
with(., term_count(dialogue, TRUE, discoure_markers)) %>%
as_terms() %>%
plot_counts() +
ggplot2::xlab("Tags")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.