Description Usage Arguments Value Examples
View source: R/viz_dispersion.R
Vizualize lexical dispersion plot
1 |
data |
A data.frame. |
var |
variable that contains the words to be visualized. |
group |
If present with show a group for each line with the words color coded. |
words |
Numerical or character. If numerical it will display the n most common words. If character will show the location of said strings. |
symbol |
The word symbol. Default to is 18 (filed diamond) when number of points are less then 200 and to 108 (vertical line) when there are more then 200 points. |
alpha |
color transperency of the word symbols. |
ggplot2 object.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
library(tidytext)
text_data <- unnest_tokens(fairy_tales, word, text)
viz_dispersion(text_data, word)
viz_dispersion(text_data, word, words = c("branches", "not a word"))
viz_dispersion(text_data, word, symbol = "2")
viz_dispersion(text_data, word, group = book)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.