donations_scrape: donations_scrape

Description Usage Arguments Details Value Examples

View source: R/donations_scrape.R

Description

scrapes OpenSecrets political campaign contribution data. This function collects donations by specific industries to congresspeople and congressional candidates

Usage

1
donations_scrape(inds, years, chambers = c("H", "S"), member = "Y")

Arguments

inds

vector of industries in string format to scrape donations from

years

vector of election years in string format identifying the elections to scrape data from

chambers

vector of chambers of Congress in string format to scrape donations to, Default: c("H", "S")

member

either "Y" or "N", include only donations to members of Congress or donations to members and failed candidate, Default: 'Y'

Details

very large requests will result in overtaxing the OpenSecrets servers and causing a HTTP 429 error, wait and rerun smaller requests when this error occurs

Value

outputs a dataframe containing contribution data including candidate information, the amount donated, the chamber of congress, the election year, and the donating industry

Examples

1
2
3
4
5
6
## Not run: 
if(interactive()){
 donations_scrape("", "2004", "H", "N")
 }

## End(Not run)

hkarp1/secretscrape documentation built on Jan. 18, 2021, 12:36 a.m.