Learn R Programming

rsunlight (version 0.7.0)

os_billlookup: Lookup bills on OpenStates.

Description

Lookup bills on OpenStates.

Usage

os_billlookup(state = NULL, session = NULL, bill_id = NULL,
  fields = NULL, per_page = NULL, page = NULL, as = "table",
  key = NULL, ...)

Arguments

state

state two-letter abbreviation (character), required

session

session of congress (integer), e.g., 2009-2010 = 20092010, required

bill_id

One or more identification numbers of bills (character), required

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.

per_page

Number of records to return. Default: 20. Max: 50.

page

Page to return. Default: 1. You can use this in combination with the per_page parameter to get more than the default or max number of results per page.

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

Run this code
# NOT RUN {
os_billlookup(state='ca', session=20092010, bill_id='AB 667')
os_billlookup(state='ca', session=20092010, bill_id='AB 667', per_page=1)
os_billlookup(state='ca', session=20092010, bill_id='AB 667', per_page=1, fields='id')
os_billlookup(state='ca', session=20092010, bill_id='AB 667',
   per_page=3, fields=c('id','title'))
os_billlookup(state='ca', session=20092010, bill_id='SB 425')
os_billlookup(state='ca', session=20092010, bill_id=c('AB 667','SB 425'))
os_billlookup(state='ca', session=20092010, bill_id='AB 667', verbose = TRUE)
# }

Run the code above in your browser using DataLab