Learn R Programming

rtimes (version 0.3.0)

rtimes-package: R interface to some of the New York Times APIs.

Description

R interface to some of the New York Times APIs.

Arguments

Details

Functions that wrap these sets of APIs are prefixed by two letter acronyms fo reach API endpoint + the function name itself as for example `cg` + `fxn`

cg
for the Congress API

as
for the Article Search API

cf
for the Campaign Finance API

geo
for the Geographic API

See the vignette for help.

Please get your own API keys at http://developer.nytimes.com/apps/register - you'll need a different key for each API.

I set up the functions so that you can put the key in your .Rprofile file, which will be called on startup of R, and then you don't have to enter your API key for each run of a function. Put these entries in your .Rprofile file

  • options(nytimes_cg_key = "YOURKEYHERE")
  • options(nytimes_as_key = "YOURKEYHERE")
  • options(nytimes_cf_key = "YOURKEYHERE")
  • options(nytimes_geo_key = "YOURKEYHERE")