Rating.getRating: Get all candidate ratings from an evaluation by a special...

Description Usage Arguments Value Author(s) References Examples

Description

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.

Usage

1
Rating.getRating(ratingId)

Arguments

ratingId

a character string or list of character strings with the rating ID(s) (see references for details)

Value

A data frame with a row for each candidate and columns with the following variables describing the candidate:
candidateRating*.candidateId,
candidateRating*.rating.

Author(s)

Ulrich Matter <ulrich.matter-at-unibas.ch>

References

http://api.votesmart.org/docs/Rating.html
Use Rating.getSigRatings() or Rating.getCandidateRating() to get a list of rating IDs.

Examples

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

umatter/pvsR documentation built on Jan. 9, 2021, 4:35 p.m.