get_itemized_contributions: Get Itemized Campaign Contributions

Description Usage Arguments Details

View source: R/get_schedule_a.R

Description

Get itemized contributions (those reported on Form F3, F3X and F3P Schedule A). Returns information about donors, their residence, occupation, and donation amount. If you just need total itemized contributions, use get_candidate_totals().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
get_itemized_contributions(data = NULL,
  api_key = Sys.getenv("DATAGOV_API_KEY"), data_structure = "tidy",
  contributor_employer = NULL, contributor_name = NULL,
  contributor_occupation = NULL, sort_null_only = NULL,
  sort_hide_null = NULL, contributor_id = NULL, max_date = NULL,
  last_contribution_receipt_date = NULL, contributor_city = NULL,
  contributor_type = NULL, sort = NULL, min_amount = NULL,
  contributor_zip = NULL, min_date = NULL, contributor_state = NULL,
  min_image_number = NULL, last_contributor_aggregate_ytd = NULL,
  image_number = NULL, max_amount = NULL, committee_id = NULL,
  last_contribution_receipt_amount = NULL, is_individual = NULL,
  max_image_number = NULL, two_year_transaction_period = NULL,
  line_number = NULL)

get_schedule_a(data = NULL, api_key = Sys.getenv("DATAGOV_API_KEY"),
  data_structure = "tidy", contributor_employer = NULL,
  contributor_name = NULL, contributor_occupation = NULL,
  sort_null_only = NULL, sort_hide_null = NULL,
  contributor_id = NULL, max_date = NULL,
  last_contribution_receipt_date = NULL, contributor_city = NULL,
  contributor_type = NULL, sort = NULL, min_amount = NULL,
  contributor_zip = NULL, min_date = NULL, contributor_state = NULL,
  min_image_number = NULL, last_contributor_aggregate_ytd = NULL,
  image_number = NULL, max_amount = NULL, committee_id = NULL,
  last_contribution_receipt_amount = NULL, is_individual = NULL,
  max_image_number = NULL, two_year_transaction_period = NULL,
  line_number = NULL)

Arguments

data

A dataframe or tibble. Usually this will be the returned result of search_candidates(). If a column is called 'committee_id', get_itemized_contributions() will return results for all IDs in that column and will attempt to join data to the result by committee_id.

api_key

API key for https://api.data.gov. Get one at https://api.data.gov/signup.

data_structure

A character describing how you want OpenFEC results. Options are 'tidy', 'list', or 'both.' Choose list for raw results.

contributor_employer

Employer of contributor, filers need to make an effort to gather this information

contributor_name

Name of contributor.

contributor_occupation

Occupation of contributor, filers need to make an effort to gather this information.

sort_null_only

Toggle that filters out all rows having sort column that is non-null.

contributor_id

The FEC identifier should be represented here if the contributor is registered with the FEC.

max_date

Maximum date.

last_contribution_receipt_date

When sorting by contribution_receipt_date, this is populated with the contribution_receipt_date of the last result. However, you will need to pass the index of that last result to last_index to get the next page.

contributor_city

City of contributor.

contributor_type

Filters individual or committee contributions based on line number.

sort

Provide a field to sort by. Use - for descending order.

min_amount

Filter for all amounts greater than a value.

contributor_zip

Zip code of contributor. Only 5-digit zip code is allowed.

min_date

Minimum date.

contributor_state

State of contributor.

last_contributor_aggregate_ytd

When sorting by contributor_aggregate_ytd, this is populated with the contributor_aggregate_ytd of the last result. However, you will need to pass the index of that last result to last_index to get the next page.

image_number

The image number of the page where the schedule item is reported.

max_amount

Filter for all amounts less than a value.

committee_id

A unique identifier assigned to each committee or filer registered with the FEC. In general committee id's begin with the letter C which is followed by eight digits.

last_contribution_receipt_amount

When sorting by contribution_receipt_amount, this is populated with the contribution_receipt_amount of the last result. However, you will need to pass the index of that last result to last_index to get the next page.

is_individual

Restrict to non-earmarked individual contributions where memo code is true. Filtering individuals is useful to make sure contributions are not double reported and in creating breakdowns of the amount of money coming from individuals.

two_year_transaction_period

This is a two-year period that is derived from the year a transaction took place in the Itemized Schedule A and Schedule B tables. In cases where we have the date of the transaction (contribution_receipt_date in schedules/schedule_a, disbursement_date in schedules/schedule_b) the two_year_transaction_period is named after the ending, even-numbered year. If we do not have the date of the transaction, we fall back to using the report year (report_year in both tables) instead, making the same cycle adjustment as necessary. If no transaction year is specified, the results default to the most current cycle.

line_number

Filter for form and line number using the following format: FORM-LINENUMBER. For example an argument such as F3X-16 would filter down to all entries from form F3X line number 16.

sort_null_hide

Hide null values on sorted column(s).

Details

OpenFEC Documentation: Schedule A records describe itemized receipts reported by a committee. This is where you can look for individual contributors. If you are interested in individual donors, /schedules/schedule_a will be the endpoint you use.

Once a person gives more than a total of $200, the donations of that person must be reported by committees that file F3, F3X and F3P forms. Contributions $200 and under are not required to be itemized, but you can find the total amount of these small donations by looking up the "unitemized" field in the /reports or /totals endpoints.

When comparing the totals from reports to line items. the totals will not match unless you only look at items where "is_individual":true since the same transaction is in the data multiple ways to explain the way it may move though different committees as an earmark.

For the Schedule A aggregateshttps://api.open.fec.gov/developers/#!/party-coordinated_expenditures/get_schedules_schedule_f, such as by_occupation and by_state, include only unique individual contributions. See below for full methodology.


stephenholzman/tidyusafec documentation built on July 29, 2020, 10:38 a.m.