searchBill: Search Bills

Description Usage Arguments Value See Also Examples

View source: R/searchBill.R

Description

Searching Bill Information in US Congress Website.

Usage

1
2
3
4
5
searchBill(key = NULL, congress = NULL, chamber = "Both",
  billtype = "bills", billstatus = NULL, subject = NULL,
  house_committee = NULL, senate_committee = NULL, party = NULL,
  pageSort = "documentNumber", pageSort_direction = "descending",
  maxN = 1000, urlonly = FALSE, searchURLprint = FALSE)

Arguments

key

A character element of keywords.

congress

A character vector of target congress(es) (e.g, c(116,115)).

chamber

A character of target chamber. One of "House", "Senate", and "Both". The default is both chambers.

billtype

A character vector of target bill types. Choose any combination of "bills", "amendments", "resolutions", "joint-resolutions", and "concurrent-resolutions". If NULL, include all types. The defauls is "bills".

billstatus

A character vector of target bill statuses. Choose any combination of "introduced", "committee","floor","failed-one","passed-one", "passed-both","resolving","president","veto", and "law". If NULL (default), include bills of all statuses.

subject

A character vector of policy subject areas. Choose any combination of subjects provided in Subject Area List. If NULL (default), include all policy areas.

house_committee

A character vector of House committees. Choose any combination of committees from House Committee List.

senate_committee

A character vector of Senate committees. Choose any combination of committees from Senate Committee List.

party

A character vector of parties of a sponsor. Choose any combination of "Democratic","Republican","Independent" and "Independent Democrat". If NULL, include any party.

pageSort

The way the bills in search are sorted. Choose one of "relevancy", "title", "documentNumber" (default), "lawNumber", "latestAction", and "dateOfIntroduction".

pageSort_direction

Direction of pageSort. Choose "descending" (default) or "ascending". Not applied if pageSort is one of "relevancy" and "title".

maxN

The max number of bills to import. The default is 1000.

urlonly

if TRUE, export character vector or bill summary page URLs. If FALSE, export data.frame of bill URLs and other extractable information from search page.

searchURLprint

If TRUE, return search page URL.

Value

If urlonly==FALSE and searchURLprint==FALSE, A data.frame that contains following variables.

See Also

getBill, read_scrapeBill, and write_scrapeBill

Examples

1
2
3
4
# Search all bills (importing only newest 10)
billdt <- searchBill(maxN=10)
# Seach bills with keyword "air" (importing newest 100)
billdt <- searchBill(key="air", maxN=100)

gentok/congressbills documentation built on Jan. 21, 2020, 5:37 a.m.