ppc_members: Get Congress data from ProPublica's API

Description Usage Arguments Details Value See Also Examples

View source: R/ppc_members.R

Description

Retrieves congress data from api.propublica.org

Usage

1
2
3
4
5
6
ppc_members(
  chamber = c("both", "house", "senate"),
  congress = "116",
  api_key = NULL,
  raw = FALSE
)

Arguments

chamber

Specify the chamber of Congress typically "house" or "senate"; sometimes "both" or "joint"

congress

The number of Congress of interest

api_key

The actual API key string provided by ProPublica.

raw

Logical indicating whether to return the raw response object. The default (FALSE) parses the content and returns a tibble data frame.

Details

To apply for a ProPublica API use the following link: https://www.propublica.org/datastore/api/propublica-congress-api. Complete and submit the provided form to receive your API key.

Value

Depending on the raw parameter, this function returns a tibble data frame with member information or the response object returned by curl

A data frame of congressional members information

See Also

https://projects.propublica.org/api-docs/congress-api/

Examples

1
2
3
4
5
## Not run: 
## get data on house for 116th congress (requires API key)
h116 <- ppc_congress(congress = "116", chamber = "house")

## End(Not run)

r-congress/ppcong documentation built on Dec. 16, 2019, 12:45 a.m.