Description Usage Arguments Details Value Author(s) References Examples
This function is essentially a wrapper around Votes.getBillActionVotes() specified for large amount of requests.
1 | getAllVotes(actionId, batchsize=100, pause=0, backupfile="votes.list.Rdata")
|
actionId |
a character string or list of character strings with the action ID(s) (see references for details) |
batchsize |
numerical, indicating how many actionIds should be processed in one batch (defaults to 100). |
pause |
numerical, indicating how long (in seconds) the download process should be paused after each batch (defaults to 0) |
backupfile |
character string for the path/file-name of the Rdata-file where the data should be saved (batch-wise) during the download process (default: "votes.list.Rdata"). |
This functions splits large requests into several batches. The requests are then processed batch-wise and are saved on the local disc to make sure that not too much RAM is assigned to the pvsR task.
A data frame with a row for each vote and columns with the following variables describing the vote:
votes.vote*.candidateId,
votes.vote*.candidateName,
votes.vote*.officeParties,
votes.vote*.action.
Ulrich Matter <ulrich.matter-at-unibas.ch>
http://api.votesmart.org/docs/Votes.html
Use Votes.getBill() or Votes.getByOfficial() to get a list of action 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 | # 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 all officials of a certain state
## Not run: bill <- Votes.getBill("17623", separate=c("actions", "sponsors"))
## Not run: actionids <- bill$actions$actionId
# get all votes on this acti
## Not run: votes <- getAllVotes(actionids, batchsize=2)
## Not run: head(votes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.