Load Associated Press Election Results with Elex

Provides R access to election results data. Wraps elex ( https://github.com/newsdev/elex/), a Python package and command line tool for fetching and parsing Associated Press election results.


elexr

Simple R wrapper around elex for loading Associated Press elections results.

Assumptions

  • Associated Press Elections API key
  • elex
  • devtools R package

Installation

First, install elex, following these instructions.

Then use devtools to install this from GitHub:

> library(devtools)
> install_github("ghing/elexr")

Usage

> library(elexr)
> Sys.setenv(AP_API_KEY = "YOUR_AP_API_KEY")
> iowa_caucus_results <- results('02-01-2016')

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("elexr")

1.0 by Geoff Hing, 11 years ago


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


Authors: Geoff Hing


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports utils

System requirements: Python (>= 2.7 or >= 3.5) and elex package


See at CRAN