Learn R Programming

pvsR (version 0.1.1)

Office.getBranches: Get a list of branches of government and their IDs

Description

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

Usage

Office.getBranches()

Arguments

Value

  • A data frame with a row for each branch and columns with variables describing the branch. The returned data frame contains a row for each branch and columns with the following variables describing the branch: branches.branch*.officeBranchId, branches.branch*.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 branches and their IDs
branches <- Office.getBranches()
branches

Run the code above in your browser using DataLab