Description Usage Arguments Value Author(s) References Examples
This function is a wrapper for the Rating.getRating() method of the PVS API Rating class which dumps all candidate ratings from a scorecard by a special interest group (SIG). The function sends a request with this method to the PVS API for all rating 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 | Rating.getRating(ratingId)
|
ratingId |
a character string or list of character strings with the rating ID(s) (see references for details) |
A data frame with a row for each candidate and columns with the following variables describing the candidate:
candidateRating*.candidateId,
candidateRating*.rating.
Ulrich Matter <ulrich.matter-at-unibas.ch>
http://api.votesmart.org/docs/Rating.html
Use Rating.getSigRatings() or Rating.getCandidateRating() to get a list of rating IDs.
1 2 3 4 5 6 | # 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 the candidate rating by a certain special interest group
## Not run: scorecard <- Rating.getRating(77)
## Not run: scorecard
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.