votes_get_by_official {votesmart}R Documentation

Get votes by official

Description

Get votes by official

Usage

votes_get_by_official(
  candidate_ids,
  office_ids = "",
  category_ids = "",
  years = "",
  all = TRUE,
  verbose = TRUE
)

Arguments

candidate_ids

Vector of candidate_ids (required). See candidates_get_by_lastname, candidates_get_by_levenshtein, and candidates_get_by_office_state.

office_ids

Vector of office_ids. See office_get_offices_by_level.

category_ids

Vector of category_ids. See rating_get_categories.

years

Vector of years in which the vote was taken.

all

Boolean: should all possible combinations of the variables be searched for, or just the exact combination of them in the order they are supplied?

verbose

Should cases when no data is available be messaged?

Value

A dataframe of candidates' votes on bills and their attributes. If a given input combination returns no data, that row will be filled with NAs.

Examples

## Not run: 
aoc <- candidates_get_by_lastname(
  "ocasio-cortez",
  election_years = "2018"
)
votes_get_by_official(aoc$candidate_id)

## End(Not run)

[Package votesmart version 0.1.2 Index]