Simple R wrapper around elex for loading Associated Press elections results.
devtools
R packageFirst, install elex, following these instructions.
Then use devtools
to install this from GitHub:
> library(devtools)
> install_github("ghing/elexr")
> library(elexr)
> Sys.setenv(AP_API_KEY = "YOUR_AP_API_KEY")
> iowa_caucus_results <- results('02-01-2016')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.