Learn R Programming

JSTORr (version 1.0.20161214)

JSTOR_2bigramscor: Plot the change over time of the correlation between one bigram (or set of bigrams) and another bigram (or set of bigrams) in a JSTOR DfR dataset

Description

Function to plot changes in the correlation of two sets of bigrams (two sets of 2-grams, or two sets of multiple bigrams) over time. For use with JSTOR's Data for Research datasets (http://dfr.jstor.org/).

Usage

JSTOR_2bigramscor(unpack2, bigram1, bigram2, span = 0.4)

Arguments

unpack2
object returned by the function JSTOR_unpack2.
bigram1
One bigram or a vector of bigrams, each bigram surrounded by standard quote marks.
bigram2
One bigram or a vector of bigrams, each bigram surrounded by standard quote marks.
span
span of the loess line (controls the degree of smoothing). Default is 0.4

Value

Returns a ggplot object with publication year on the horizontal axis and Pearson's correlation on the vertical axis. Each point represents all the documents of a single year, point size is inversely proportional to p-value of the correlation.

Examples

Run this code
## JSTOR_2bigramscor(unpack2, bigram1 = "hot water", bigram2 = "cold water")
## JSTOR_2bigramscor(unpack2, c("hot water", "warm water", "tepid water"),  c("cold water", "ice water"))

Run the code above in your browser using DataLab