ngram analysis

Stephen Peplow

This takes a little effort to get going, but is easy to implement once you have the R packages installed.

  1. Go to Sean Carmody's The Stubborn Mule blog as indicated in the post on my blog.
  2. The links will take you the package for ngramr which is on GITHUB.
require(ngramr)
## Loading required package: ngramr
spdata <- ngram(c("vegan", "GMO", "world hunger"), year_start = 1960)
require(ggplot2)
## Loading required package: ggplot2
ggplot(spdata, aes(x = Year, y = Frequency, colour = Phrase)) + geom_line(lwd = 2)

plot of chunk unnamed-chunk-1

The data is now available to you and you can reformat it/plot it in any way you like.