Learn R Programming

rsunlight (version 0.7.0)

votes: votes methods

Description

votes methods

Usage

cg_vote(congress, chamber, session, id, key = NULL, as = "table", ...)

cg_votes_recent(chamber, key = NULL, as = "table", ...)

cg_votes_type(congress, chamber, type, key = NULL, as = "table", ...)

cg_votes_date(chamber, year = NULL, month = NULL, start_date = NULL, end_date = NULL, key = NULL, as = "table", ...)

cg_votes_senatenoms(congress, key = NULL, as = "table", ...)

cg_votes_explanations(congress, votes = FALSE, key = NULL, as = "table", ...)

cg_votes_explanations_category(congress, category, key = NULL, as = "table", ...)

cg_votes_explanations_member(member_id, congress, votes = FALSE, category = NULL, key = NULL, as = "table", ...)

cg_votes_explanations_member(member_id, congress, votes = FALSE, category = NULL, key = NULL, as = "table", ...)

Arguments

congress

(character) The number of the Congress this update took place during.

chamber

(character) The chamber this update took place in. 'house' or 'senate'.

session

(integer) 1 or 2, depending on year (1 is odd-numbered years, 2 is even-numbered years)

id

(integer) roll call number, i.e., vote id

key

your ProPublica API key; pass in or loads from environment variable stored as PROPUBLICA_API_KEY in either your .Renviron, or similar file locatd in your home directory

as

(character) IGNORED FOR NOW

...

optional curl options passed on to crul::HttpClient. See curl::curl_options()

type

(character) the vote type, one of missed, party, loneno or perfect

year

(integer) a four digit year of the form YYYY

month

(integer) a 1 or 2 digit month

start_date, end_date

(character) start and end date, of the form YYYY-MM-DD

votes

(logical) whether to return votes data or not. default: FALSE

category

attribute describing the general reason for the absence or incorrect vote. see Details.

member_id

(character) The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress (http://bioguide.congress.gov/biosearch/biosearch.asp) or can be retrieved from a cg_members() request

Value

various things for now, since return objects vary quite a bit among the different votes routes

Categories for the <code>category</code> parameter

  • voted-incorrectly: Voted yes or no by mistake

  • official-business: Away on official congressional business

  • ambiguous: No reason given

  • travel-difficulties: Travel delays and issues

  • personal: Personal or family reason

  • claims-voted: Vote made but not recorded

  • medical: Medical issue for lawmaker (not family)

  • weather: Inclement weather

  • memorial: Attending memorial service

  • misunderstanding: Not informed of vote

  • leave-of-absence: Granted leave of absence

  • prior-commitment: Attending to prior commitment

  • election-related: Participating in an election

  • military-service: Military service

  • other: Other

Examples

Run this code
# NOT RUN {
cg_vote(115, "senate", 1, 17)
cg_votes_recent("senate")
cg_votes_type(114, "house", "missed")
cg_votes_date("senate", year = 2017, month = 1)
cg_votes_date("senate", year = 2017, month = 3)
cg_votes_date("senate", start_date = "2017-01-03", end_date = "2017-01-31")
cg_votes_senatenoms(114)
cg_votes_explanations(114, votes = FALSE)
cg_votes_explanations(114, votes = TRUE)
cg_votes_explanations_category(114, "voted-incorrectly")
cg_votes_explanations_member("S001193", 115, votes = FALSE)
cg_votes_explanations_member("S001193", 115, votes = TRUE)
cg_votes_explanations_member("S001193", 115, votes = TRUE,
 category = "personal")
# }

Run the code above in your browser using DataLab