Learn R Programming

pvsR (version 0.1.1)

Office.getLevels: Get a list of levels of government and their IDs

Description

This function is a wrapper for the Office.getLevels() method of the PVS API Office class which grabs a list of the levels of government and their IDs.

Usage

Office.getLevels()

Arguments

Value

  • A data frame with a row for each level and columns with variables describing the level. The returned data frame contains a row for each level and columns with the following variables describing the level: levels.level*.officeLevelId, levels.level*.name.

References

http://api.votesmart.org/docs/Office.html

Examples

Run this code
# First, make sure your personal PVS API key is saved as character string in the pvs.key variable:
pvs.key <- "yourkey"
# get a list of government levels and their IDs
levels <- Office.getLevels()
levels

Run the code above in your browser using DataLab