Retrieve and Plot Google n-Gram Data

Retrieve and plot word frequencies through time from the "Google Ngram Viewer" < https://books.google.com/ngrams>.


News

  • Fixed problems with (some) advanced operators
  • Removed debugging from ngrami
  • Fixed the Pulser bug
  • Fix accented character encoding problem on Windows
  • Improve ssl handling (refer Hadley's comment here: http://www.statsravingmad.com/blog/statistics/a-tiny-rcurl-headache/)

Google has switched to SSL for the N-gram viewer and the format of the web-pages has changed. This means that earlier versions of the package are completely broken. This release fixes this major problem.

  • Add README.md to .Rbuildignore to remove from CRAN
  • Fix count for n-grams with n>1, including a "fudge" for 2012 corpuses
  • Add option to display long-form corpus name
  • Warn about smoothing >0 for geoms other than "line"
  • Tidy documentation for print.ngram
  • ngram and ngrami return S3 class "ngram"
  • Format print for ngram objects
  • ggram can take either a list of phrases or an ngram object
  • Add option to relabel y-axis
  • Add word counts option to ngram
  • Change ggplot2 and scales from Requires to Suggests
  • Prevent use of complex operators in case insensitive searchs
  • Warn about character substitution
  • CRAN release version
  • More efficient handling of escaped Unicode (thanks Hadley http://stackoverflow.com/a/17787736/1543437)
  • Fix package checking problems associated with plyr
  • Tidy Google theme

First semi-offical release. All future development moved to the 'develop' branch.

  • Allow case insensitive plotting with ggram
  • Avoid reshape/reshape2 conflicts (thanks to Francois Briatte)
  • Pass arbitrary geoms to ggram
  • New function ngramw to return results in "wide" format
  • Removed wide option from ggram and ggrami
  • Better handling of legends when ignore_case = TRUE
  • Error trapping long phrase lists
  • Google theme option
  • Added plot wrapper ggram
  • Detect invalid corpus names
  • Initial release of the ngramr package

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ngramr")

1.7.2 by Sean Carmody, a month ago


https://github.com/seancarmody/ngramr


Report a bug at https://github.com/seancarmody/ngramr/issues


Browse source code at https://github.com/cran/ngramr


Authors: Sean Carmody [aut, cre, cph]


Documentation:   PDF Manual  


Task views:


GPL (>= 2) license


Imports httr, rlang, RCurl, dplyr, cli, tibble, tidyr, rjson, stringr, ggplot2, scales, xml2, textutils, lifecycle

Suggests testthat


See at CRAN