Description Usage Arguments Value Examples
Function to plot changes in the relative frequency of two words (two 1-grams) over time. The relative frequency is the frequency of the word in a document divided by the total number of words in a document. For use with JSTOR's Data for Research datasets (http://dfr.jstor.org/).
1 2 | JSTOR_2words(unpack1grams, word1, word2, span = 0.4, se = FALSE,
yearfrom = NULL, yearto = NULL)
|
unpack1grams |
object returned by the function JSTOR_unpack1grams. |
word1 |
One word (or vector of words), surrounded by standard quote marks. |
word2 |
One word (or vector of words), surrounded by standard quote marks. |
span |
span of the lowess line (controls the degree of smoothing). Default is 0.4 |
se |
display standard error of lowess line. Default is no (false). |
yearfrom |
year to start the x-axis from, the minimum year to display on the plot |
yearto |
year to end the x-axis at, the maximum year to display on the plot |
Returns a ggplot object with publication year on the horizontal axis and log relative frequency on the vertical axis. Each point represents a single document.
1 2 3 | ## JSTOR_2words(unpack1grams, "diamonds", "pearls")
## JSTOR_2words(unpack1grams, word1 = "milk", word2 = "sugar", span = 0.8) +
## scale_y_continuous(trans=log2_trans()) # to diminish the effect of a few extreme values
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.