knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of ppcongress is to provide an R interface to ProPublica's Congress API. The following endpoints have been mapped:
The following endpoints are on the roadmap:
Please file an issue if there are other endpoints you want added.
You can install the development version of ppcongress from GitHub with:
remotes::install_github("zamorarr/ppcongress")
You also need to sign up to get an API Key from ProPublica's Data Store. Put this key in your .Renviron file by opening it:
usethis::edit_r_environ()
Then adding the following line, replacing XXX with your own key.
PROPUBLICA_API_KEY=XXX
library(ppcongress)
You can get a list of all the members of the 116th congress in the house with the members()
function:
json <- members("house", 116) print(json)
The function as_tibble()
will convert this list object to a data frame:
df <- as_tibble(json) print(df)
You can get a list of all upcoming bills in the house:
json <- bills_upcoming("house") print(json)
as_tibble(json)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.