Description Usage Arguments Value Author(s) References Examples
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.
1 | Votes.getBill(billId,...)
|
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"). |
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.
Ulrich Matter <ulrich.matter-at-unibas.ch>
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # First, make sure your personal PVS API key is saved as an option
# (options("pvs.key" = "yourkey")) or 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.