Votes.getBill: Get general information on a bill

Description Usage Arguments Value Author(s) References Examples

Description

This function is a wrapper for the Votes.getBill() method of the PVS API Votes class which grabs the general information on a bill. The function sends a request with this method to the PVS API for all bill IDs given as a function input, extracts the XML values from the returned XML file(s) and returns them arranged in one data frame.

Usage

1

Arguments

billId

a character string or list of character strings with the bill ID(s) (see references for details)

...

further arguments that are passed on to internal functions. Currently the argument separate can be defined: separate is a vector of character strings defining subnodes that should be returned separately (e.g., "sponsors").

Value

If separate is not specified, a data frame with a row for each bill and columns with variables describing the bill. If separate is specified, a list containing several data frames, one for each subnode mentioned in separate and additionally one data frame containing all remaining nodes not mentioned in separate. The returned data frame contains a row for each bill and columns with the following variables describing the bill:
bill.billnumber,
bill.parentbill,
bill.title,
bill.officialtitle,
bill.dateintroduced,
bill.type,
bill.categories.category*.categoryId,
bill.categories.category*.name,
bill.billtextLink,
bill.sponsors.sponsor*.candidateId,
bill.sponsors.sponsor*.name,
bill.sponsors.sponsor*.type,
bill.committeeSponsors.committeeSponsor*.committeeId,
bill.committeeSponsors.committeeSponsor*.name,
bill.actions.action*.actionId,
bill.actions.action*.level,
bill.actions.action*.stage,
bill.actions.action*.outcome,
bill.actions.action*.statusDate,
bill.actions.action*.rollNumber,
bill.actions.action*.yea,
bill.actions.action*.nay,
bill.actions.action*.voiceVote,
bill.amendments.amendment*.billNumber,
bill.amendments.amendment*.actionId,
bill.amendments.amendment*.title,
bill.amendments.amendment*.statusDate.

Author(s)

Ulrich Matter <ulrich.matter-at-unibas.ch>

References

http://api.votesmart.org/docs/Votes.html
Use Votes.getByBillNumber(), Votes.getBillsByCategoryYearState(), Votes.getBillsByYearState(), Votes.getBillsByOfficialYearOffice(), Votes.getBillsByOfficialCategoryOffice(), Votes.getByOfficial(), Votes.getBillsBySponsorYear(), Votes.getBillsBySponsorCategory() or Votes.getBillsByStateRecent() to get a list of bill IDs.
See also: Matter U, Stutzer A (2015) pvsR: An Open Source Interface to Big Data on the American Political Sphere. PLoS ONE 10(7): e0130501. doi: 10.1371/journal.pone.0130501

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# First, make sure your personal PVS API key is saved as character string in the pvs.key variable:
## Not run: pvs.key <- "yourkey"
# get information about certain bills
## Not run: billinfo <- Votes.getBill(list(2819,6427))
## Not run: billinfo
# let some variables with subnodes be returned separately (here: "sponsors" and "actions")
## Not run: billinfo2 <- Votes.getBill(billId=list(2819,6427,6590),
separate=c("sponsors","actions"))
## End(Not run)
## Not run: billinfo2
# check the sponsors of the requested bill (argument of separate)... 
## Not run: billinfo2$sponsors
# ... and the usual variables describing the bill (nodes not mentioned in separate)
## Not run: billinfo2$main

umatter/pvsR documentation built on May 31, 2019, 1:55 a.m.