Description Usage Arguments Details Value Author(s) References Examples
View source: R/getAllDetailedBios.R
This function is essentially a wrapper around CandidateBio.getDetailedBio() specified for large amount of requests.
1 | getAllBios(candidateId, batchsize=100, pause=0, backupfile="bios.list.Rdata")
|
candidateId |
a character string or list of character strings with the candidate ID(s) (see references for details) |
batchsize |
numerical, indicating how many candidateIds 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: "bios.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 list with several data frames containing the elements of CandidateBio.getBio(), and expands upon:
bio.candidate.education.degree,
bio.candidate.education.field,
bio.candidate.education.school,
bio.candidate.education.span,
bio.candidate.education.gpa,
bio.candidate.education.fullText,
bio.candidate.profession.title,
bio.candidate.profession.organization,
bio.candidate.profession.span,
bio.candidate.profession.special,
bio.candidate.profession.district,
bio.candidate.profession.fullText,
bio.candidate.political.title,
bio.candidate.political.organization,
bio.candidate.political.span,
bio.candidate.political.special,
bio.candidate.political.district,
bio.candidate.political.fullText,
bio.candidate.congMembership.title,
bio.candidate.congMembership.organization,
bio.candidate.congMembership.span,
bio.candidate.congMembership.special,
bio.candidate.congMembership.district,
bio.candidate.congMembership.fullText,
bio.candidate.orgMembership.title,
bio.candidate.orgMembership.organization,
bio.candidate.orgMembership.span,
bio.candidate.orgMembership.special,
bio.candidate.orgMembership.district,
bio.candidate.orgMembership.fullText.
Ulrich Matter <ulrich.matter-at-unibas.ch>
http://api.votesmart.org/docs/CandidateBio.html
Use Candidates.getByOfficeState(), Candidates.getByOfficeTypeState(), Candidates.getByLastname(), Candidates.getByLevenshtein(), Candidates.getByElection(), Candidates.getByDistrict() or Candidates.getByZip() to get a list of candidate 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: officials <- Officials.getStatewide("FL")
# get all biographical information on those officials
## Not run: bios <- getAllDetailedBios(officials$candidateId[1:100], batchsize=20)
## Not run: str(bios)
## Not run: head(bios$education)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.