member_search: Query the Voteview Database for Members

Description Usage Arguments Details Value See Also Examples

View source: R/search.R

Description

This function allows you to search for various members of congress and presidents using several key fields.

Usage

1
2
member_search(name = NULL, icpsr = NULL, state = NULL,
  party_code = NULL, congress = NULL, chamber = NULL, distinct = 0)

Arguments

name

A string with the name of the member of congress that you would like to search. If it is only one word, it searches by last name. If there are multiple words it uses a text index of all of the name fields and returns the best matches.

icpsr

A string or number with the icpsr number you would like to search by. Can also be the internal id that we use for unique legislator-congress-party records.

state

A string or number that is either be the ICPSR state number, the two letter state code, or the full state name.

congress

A numeric vector of the congresses to constrain the search to.

chamber

A string that is either "House" or "Senate".

distinct

Either a 0 or a 1. A 0 Returns all records that match your query while a 1 only returns the first record that has a specific icpsr number. Note that our database has multple records per icpsr number as our records are unique to legislator-congress-party while icpsr number construction tries to follow a legislator through congresses and across meaningless party switches.

Details

The arguments are joined by an AND command, and all arguments can only be of length 1 except for the congress argument which can take a vector. This method will only return 5000 records at a time.

Value

A data.frame with data for members of Congress. The columns will be described in forthcoming data documentation. Importantly, id is the internal id that our system uses.

See Also

'voteview_search'.

Examples

1
2
## Search for Obama
res <- member_search("obama")

voteview/Rvoteview documentation built on Oct. 16, 2019, 4:19 a.m.