Travis build status AppVeyor build status

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

ppcongress

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.

Installation

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

Example

library(ppcongress)

Members

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)

Bills

You can get a list of all upcoming bills in the house:

json <- bills_upcoming("house")
print(json)
as_tibble(json)


zamorarr/ppcongress documentation built on Nov. 5, 2019, 1:23 p.m.