os_districts: Search OpenStates districts

Description Usage Arguments Details Value Examples

View source: R/os_districts.R

Description

Search OpenStates districts

Usage

1
2
3
os_districts(state, chamber = NULL, abbr = NULL, boundary_id = NULL,
  id = NULL, legislators = NULL, name = NULL, num_seats = NULL,
  as = "table", key = NULL, ...)

Arguments

state

state two-letter abbreviation (character). required

chamber

Whether this district belongs to the upper or lower chamber. (character)

abbr

State abbreviation. (character)

boundary_id

boundary_id used in District Boundary Lookup (character)

id

A unique ID for this district (separate from boundary_id).

legislators

List of legislators that serve in this district. (may be more than one if num_seats > 1)

name

Name of the district (e.g. '14', '33A', 'Fifth Suffolk')

num_seats

Number of legislators that are elected to this seat. Generally one, but will be 2 or more if the seat is a multi-member district.

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

Details

this route appears to not support pagination, sorting or selecting fields

Value

a data.frame of bills.

Examples

1
2
3
4
5
6
7
8
## Not run: 
os_districts(state = 'tx')
os_districts(state = 'tx', chamber = 'upper')
os_districts(state = 'dc')
os_districts(state = 'dc', per_page=3)
os_districts(state = 'dc', per_page=3, sort='created_at')

## End(Not run)

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