Local.getOfficials: Get officials for a locality

Description Usage Arguments Value Author(s) References Examples

Description

This function is a wrapper for the Local.getOfficials() method of the PVS API Local class which returns a list of officials in a locality. The function sends a request with this method to the PVS API for all local 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

Arguments

localId

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

Value

A data frame with a row for each official and columns with the following variables describing the official:
candidatelist.candidate*.candidateId,
candidatelist.candidate*.firstName,
candidatelist.candidate*.nickName,
candidatelist.candidate*.middleName,
candidatelist.candidate*.lastName,
candidatelist.candidate*.suffix,
candidatelist.candidate*.title,
candidatelist.candidate*.electionParties,
candidatelist.candidate*.electionDistrictId,
candidatelist.candidate*.electionStateId,
candidatelist.candidate*.officeParties,
candidatelist.candidate*.officeDistrictId,
candidatelist.candidate*.officeDistrictName,
candidatelist.candidate*.officeStateId,
candidatelist.candidate*.officeId,
candidatelist.candidate*.officeName,
candidatelist.candidate*.officeTypeId.

Author(s)

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

References

http://api.votesmart.org/docs/Local.html
Use Local.getCounties() or Local.getCities() to get a list of local IDs.

Examples

1
2
3
4
5
# First, make sure your personal PVS API key is saved as character string in the pvs.key variable:
## Not run: pvs.key <- "yourkey"
# get a list of officials according to certain local IDs
## Not run: officials <- Local.getOfficials(list(3200,3203))
## Not run: officials

pvsR documentation built on May 2, 2019, 5:16 a.m.