os_legislatorsearch: Search Legislators on OpenStates.

Description Usage Arguments Value Examples

View source: R/os_legislatorsearch.R

Description

Search Legislators on OpenStates.

Usage

1
2
3
os_legislatorsearch(state = NULL, first_name = NULL, last_name = NULL,
  chamber = NULL, active = NULL, term = NULL, district = NULL,
  party = NULL, fields = NULL, as = "table", key = NULL, ...)

Arguments

state

state two-letter abbreviation (character)

first_name

first name of legislator (character)

last_name

last name of legislator (character)

chamber

one of 'upper' or 'lower' (character)

active

TRUE or FALSE (character)

term

filter by legislators who served during a certain term (character)

district

legislative district (character)

party

democratic or republican (character)

fields

You can request specific fields by supplying a vector of fields names. Many fields are not returned unless requested. If you don't supply a fields parameter, you will get the most commonly used subset of fields only. To save on bandwidth, parsing time, and confusion, it's recommended to always specify which fields you will be using.

as

(character) One of table (default), list, or response (crul response object)

key

your SunlightLabs API key; loads from .Rprofile

...

Curl options passed on to crul::HttpClient

Value

List of output fields.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
os_legislatorsearch(state = 'ca', party = 'democratic')
os_legislatorsearch(state = 'tx', party = 'democratic', active = TRUE)
os_legislatorsearch(state = 'nv', party = 'republican')
os_legislatorsearch(state = 'dc', chamber = 'upper')

# pass in more than one value for some parameters
os_legislatorsearch(state = c('dc', 'or'), chamber = 'upper')
os_legislatorsearch(first_name = c('jane', 'bob'), chamber = 'upper')

## End(Not run)

rsunlight documentation built on May 1, 2019, 10:18 p.m.