Description Usage Arguments Value See Also Examples
Parses and arranges XML output from LegiScan master data downloads and stores the results in a list of data frames.
1 | legiscanBill(rawBill, fullText = c("state_link", "url"))
|
rawBill |
An XML file object from the bill subdirectory of the master download |
fullText |
A character vector identifying where to retrieve the full text of the bills (e.g., LegiScan site 'url' or official sites 'state_link') |
Creates a list object containing a several data.frame objects. The objects include the bill's meta data, status, history, text, and vote histories.
Other Parsing and Cleaning LegiScan Data: billids
;
fileLists
; fileStructure
;
getFullText
; legiBillHist
;
legiBillJSON
; legiBillMeta
;
legiBillProg
; legiBillSpons
;
legiBillTxt
; legiPersonJSON
;
legiVotesJSON
;
legiscanPerson
;
legiscanVotes
; xjformat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Build directory structure from master data downloads
directoryTree <- fileStructure("data/msHistorical/")
# Create object with all file references stored in it
files <- fileLists(directoryTree)
# Pass the function a bill object for processing
bills <- legiscanBill(files[["bills"]][[1]][[1]])
# When working with archive files, the process is fairly computationally intense due to
# the large volume of I/O operations. However, this is a process that may only need to be
# run on an annual/semi-annual basis as a means of building data to load into a data warehouse.
# To parse the entire archive you can do:
library(doMC)
registerDoMC(cores = 8)
bills <- list()
for (i in names(files[["bills"]])) {
# Builds a large list of data frame objects
bills[[i]] <- plyr::llply(files[["bills"]][[i]], legiscanBill, .parallel = TRUE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.