Title: | Washington State Legislative Explorer |
---|---|
Description: | Gets data from the Washington State Legislature. |
Authors: | Rohnin Randles [aut, cre] |
Maintainer: | Rohnin Randles <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.2.0 |
Built: | 2025-02-17 05:46:08 UTC |
Source: | https://github.com/rwrandles/washex-r |
Get a listing of all RCW citations affected by a given bill
getAffectedRCW(biennium, billId, paired = TRUE, type = c("df", "list", "xml"))
getAffectedRCW(biennium, billId, paired = TRUE, type = c("df", "list", "xml"))
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billId |
Character vector containing the bill(s) to be retrieved. Each argument should take the form "XX YYYY", where XX is the prefix (HB, SB, etc.) and YYYY is the bill number. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getAffectedRCW
returns an object of type equal to the
type
argument (defaults to dataframe)
for more information on RCW codes, see https://apps.leg.wa.gov/rcw/
## usage for a single bill case, XML form getAffectedRCW("2005-06", "HB 1427", type = "xml") ## generates a dataframe of affected codes from all bills in 2007 ## Not run: bills <- getLegislationByYear("2007") codesAffected <- getAffectedRCW("2007-08", bills$BillId) ## End(Not run)
## usage for a single bill case, XML form getAffectedRCW("2005-06", "HB 1427", type = "xml") ## generates a dataframe of affected codes from all bills in 2007 ## Not run: bills <- getLegislationByYear("2007") codesAffected <- getAffectedRCW("2007-08", bills$BillId) ## End(Not run)
Get a list of all proposed amendments (accepted and rejected) on the bill, including the URL to the amendment text
getAmendments( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
getAmendments( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billNumber |
Character or numeric vector containing the bill number(s) to be retrieved. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getAmendments
returns an object of type equal to the
type
argument (defaults to dataframe)
## get amendments for a single bill getAmendments("2007-08", "1001") ## get amendments for a specific set of bills years <- c("2005-06","2007-08","2007-08") bills <- c(1447,1219,1001) getAmendments(years, bills, paired = TRUE, type = "df")
## get amendments for a single bill getAmendments("2007-08", "1001") ## get amendments for a specific set of bills years <- c("2005-06","2007-08","2007-08") bills <- c(1447,1219,1001) getAmendments(years, bills, paired = TRUE, type = "df")
Get sponsor information for a bill
getBillSponsors(biennium, billId, paired = TRUE, type = c("df", "list", "xml"))
getBillSponsors(biennium, billId, paired = TRUE, type = c("df", "list", "xml"))
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billId |
Character vector containing the bill(s) to be retrieved. Each argument should take the form "XX YYYY", where XX is the prefix (HB, SB, etc.) and YYYY is the bill number. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getBillSponsors
returns an object of type equal to the
type
argument (defaults to dataframe)
## get the list of all sponsors on a set of bills, filtered for primary sponsorship spons <- getBillSponsors("2007-08", c("HB 1001", "HB 1002", "HB 1003")) if(!is.null(spons)) sponsP <- subset(spons, Type == "Primary")
## get the list of all sponsors on a set of bills, filtered for primary sponsorship spons <- getBillSponsors("2007-08", c("HB 1001", "HB 1002", "HB 1003")) if(!is.null(spons)) sponsP <- subset(spons, Type == "Primary")
Get committee members
getCommitteeMembers( biennium, agency = c("House", "Senate"), name, paired = FALSE, type = c("df", "list", "xml") )
getCommitteeMembers( biennium, agency = c("House", "Senate"), name, paired = FALSE, type = c("df", "list", "xml") )
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
agency |
One of "House" or "Senate", or a vector with these as its elements. |
name |
Character vector of committee names. To get the committee names
for a particular session, see |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getCommitteeMembers
returns an object of type equal to the
type
argument (defaults to dataframe)
## get all committee members for a select number of committees and years years <- c("2011-12","2013-14") comms <- c("Education","Judiciary") getCommitteeMembers(years, agency = "House", comms, paired = TRUE)
## get all committee members for a select number of committees and years years <- c("2011-12","2013-14") comms <- c("Education","Judiciary") getCommitteeMembers(years, agency = "House", comms, paired = TRUE)
Get a list of all committees that were active during the biennium, along with their respective committee code
getCommittees(biennium, type = c("df", "list", "xml"))
getCommittees(biennium, type = c("df", "list", "xml"))
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getCommittees
returns an object of type equal to the
type
argument (defaults to dataframe)
getCommittees("2007-08")
getCommittees("2007-08")
Get the current status of a given bill
getCurrentStatus( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
getCurrentStatus( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billNumber |
Character or numeric vector containing the bill number(s) to be retrieved. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getCurrentStatus
returns an object of type equal to the
type
argument (defaults to dataframe)
This function returns the bill's status as of today. If a bill
was never passed, it lists the most recent status. To
get a bill's complete history, use getStatusChanges
getCurrentStatus("2007-08", "1001") ## get final status for all bills written in 2011 ## Not run: billNums <- getLegislationByYear("2011") status <- getCurrentStatus("2011-12", billNums$billNumber) ## End(Not run)
getCurrentStatus("2007-08", "1001") ## get final status for all bills written in 2011 ## Not run: billNums <- getLegislationByYear("2011") status <- getCurrentStatus("2011-12", billNums$billNumber) ## End(Not run)
Get a list of dates, locations, and descriptions of all committee hearings on a particular bill
getHearings(biennium, billNumber, paired = TRUE, type = c("df", "list", "xml"))
getHearings(biennium, billNumber, paired = TRUE, type = c("df", "list", "xml"))
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billNumber |
Character or numeric vector containing the bill number(s) to be retrieved. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getHearings
returns an object of type equal to the
type
argument (defaults to dataframe)
Due to the nature of the resulting XML document,
the function trims data from excessively nested lists when
type = "df"
. In order to access the full information, use
type = "list"
instead.
## get hearings for all senate bills in 2011 bills <- getLegislationByYear("2011") if(!is.null(bills)) billsSenate <- subset(bills, OriginalAgency == "Senate") ## Not run: getHearings(billsSenate$Biennium, billsSenate$BillNumber, paired = TRUE, type = "df")
## get hearings for all senate bills in 2011 bills <- getLegislationByYear("2011") if(!is.null(bills)) billsSenate <- subset(bills, OriginalAgency == "Senate") ## Not run: getHearings(billsSenate$Biennium, billsSenate$BillNumber, paired = TRUE, type = "df")
Get legislative summary information for a particular bill, including bill ID, introduction date, bill title(s), and description
getLegislation( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
getLegislation( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billNumber |
Character or numeric vector containing the bill number(s) to be retrieved. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getLegislation
returns an object of type equal to the
type
argument (defaults to dataframe)
getLegislation("2007-08", "1001") ## get XML data for the first 100 hundred bills of the 2007-08 session ## Not run: getLegislation("2007-08", 1001:1100, type = "xml")
getLegislation("2007-08", "1001") ## get XML data for the first 100 hundred bills of the 2007-08 session ## Not run: getLegislation("2007-08", 1001:1100, type = "xml")
Get a list of all bills introduced during the year
getLegislationByYear(year, type = c("df", "list", "xml"))
getLegislationByYear(year, type = c("df", "list", "xml"))
year |
Character or numeric vector representing the year(s) to be searched. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getLegislationByYear
returns an object of type equal to the
type
argument (defaults to dataframe)
## Not run: getLegislationByYear("2007")
## Not run: getLegislationByYear("2007")
Get a dataframe containing all of the bills that originated in a given chamber and were eventually signed into law
getLegislationSigned( biennium, agency = c("House", "Senate"), paired = FALSE, type = c("df", "list", "xml") )
getLegislationSigned( biennium, agency = c("House", "Senate"), paired = FALSE, type = c("df", "list", "xml") )
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
agency |
One of "House" or "Senate", or a vector with these as its elements. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getLegislationSigned
returns an object of type equal to the
type
argument (defaults to dataframe)
## get all bills signed into law from the Senate between 2007-2010 bienniums <- c("2007-08", "2009-10") getLegislationSigned(bienniums, "Senate")
## get all bills signed into law from the Senate between 2007-2010 bienniums <- c("2007-08", "2009-10") getLegislationSigned(bienniums, "Senate")
Get a list of all bills which reference or amend a particular portion of the Revised Code of Washington (RCW)
getRCWBills(biennium, rcwCite, paired = FALSE, type = c("df", "list", "xml"))
getRCWBills(biennium, rcwCite, paired = FALSE, type = c("df", "list", "xml"))
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
rcwCite |
Character vector for the citation in the RCW to pull legislation from. Optional extensions for title, chapter, and section are allowed. For more information, see https://apps.leg.wa.gov/rcw/ |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getRCWBills
returns an object of type equal to the
type
argument (defaults to dataframe)
getRCWBills("2007-08", "13.40.0357")
getRCWBills("2007-08", "13.40.0357")
Get an XML containing roll call information for all recorded votes on a bill
getRollCalls.xml(biennium, billNumber, paired = TRUE) getRollCalls.summary( biennium, billNumber, paired = TRUE, type = c("df", "list") ) getRollCalls.votes(biennium, billNumber, paired = TRUE, type = c("df", "list"))
getRollCalls.xml(biennium, billNumber, paired = TRUE) getRollCalls.summary( biennium, billNumber, paired = TRUE, type = c("df", "list") ) getRollCalls.votes(biennium, billNumber, paired = TRUE, type = c("df", "list"))
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billNumber |
Character or numeric vector containing the bill number(s) to be retrieved. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getRollCalls.xml
returns a list of XML objects for each bill.
getRollCalls.summary
and getRollCalls.votes
return objects of type equal to the
type
argument (defaults to dataframe)
Due to the nested nature of the resulting document,
we provide various functions to present simplified views of the data
that are compatible with more parsimonious data structures. To see the
full, original data, use getRollCalls.xml
instead.
votes <- getRollCalls.summary("2007-08", "1001") # get roll call votes if(!is.null(votes)) { length(votes) # total number of roll call votes recorded votes$CountYeas[3] # number of yea votes on roll call vote #3 } ## example: get member id's for all representatives voting against the bill ## on final passage votes <- getRollCalls.votes("2007-08", "1001") if(!is.null(votes)) { nay_votesFP <- subset(votes, (Motion == "Final Passage" & Vote == "Nay")) print(nay_votesFP$MemberId) }
votes <- getRollCalls.summary("2007-08", "1001") # get roll call votes if(!is.null(votes)) { length(votes) # total number of roll call votes recorded votes$CountYeas[3] # number of yea votes on roll call vote #3 } ## example: get member id's for all representatives voting against the bill ## on final passage votes <- getRollCalls.votes("2007-08", "1001") if(!is.null(votes)) { nay_votesFP <- subset(votes, (Motion == "Final Passage" & Vote == "Nay")) print(nay_votesFP$MemberId) }
Get a list of all sponsors (all congressmembers) for a given biennium
getSponsors(biennium, type = c("df", "list", "xml"))
getSponsors(biennium, type = c("df", "list", "xml"))
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getSponsors
returns an object of type equal to the
type
argument (defaults to dataframe)
getSponsors("2007-08")
getSponsors("2007-08")
Get a complete history of all status changes that occurred on a particular bill
getStatusChanges( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
getStatusChanges( biennium, billNumber, paired = TRUE, type = c("df", "list", "xml") )
biennium |
Character vector representing the biennium(s) to be searched. Each argument should take the form "XXXX-YY" |
billNumber |
Character or numeric vector containing the bill number(s) to be retrieved. |
paired |
If TRUE, will assume that equal length vectors represent paired data. Set to FALSE to generate an NxN grid of input arguments. Applies to equal length vector inputs only. |
type |
One of "df", "list", or "xml". Specifies the format for the output. |
getStatusChanges
returns an object of type equal to the
type
argument (defaults to dataframe)
getStatusChanges("2007-08", "1001", type = "list")
getStatusChanges("2007-08", "1001", type = "list")