candidates_get_by_lastname {votesmart}R Documentation

Get candidate data by last name

Description

Get candidate data by last name

Usage

candidates_get_by_lastname(
  last_names,
  election_years = lubridate::year(lubridate::today()),
  stage_ids = "",
  all = TRUE,
  verbose = TRUE
)

Arguments

last_names

Vector of candidate last names

election_years

Vector of election years. Default is the current year.

stage_ids

The stage_id of the election ("P" for primary or "G" for general). See also election_get_election_by_year_state.

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 and their attributes. If a given last_name + election_year + stage_id combination returns no data, that row will be filled with NAs.

Examples

## Not run: 
candidates_get_by_lastname(c("Ocasio-Cortez", "Omar"), 2018)

## End(Not run)

[Package votesmart version 0.1.2 Index]