Learn R Programming

pvsR (version 0.1.1)

Committee.getCommittee: Get detailed committee (contact) information

Description

This function is a wrapper for the Committee.getCommittee() method of the PVS API Committee class which returns detailed committee data. The function sends a request with this method to the PVS API for all committee 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

Committee.getCommittee(committeeId)

Arguments

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

Value

  • A data frame with a row for each committee and columns with variables describing the committee. The returned data frame contains a row for each committee and columns with the following variables describing the committee: committee.committeeId, committee.parentId, committee.stateId, committee.committeeTypeId, committee.name, committee.jurisdiction, committee.contact.address1, committee.contact.address2, committee.contact.city, committee.contact.state, committee.contact.zip, committee.contact.phone, committee.contact.fax, committee.contact.email, committee.contact.url, committee.contact.staffContact.

References

http://api.votesmart.org/docs/Committee.html Use CandidateBio.getBio(), Committee.getCommitteesByTypeState() or Votes.getBill() to get committee ID(s).

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 information about a certain committee
committee <- Committee.getCommittee(list(1,2))
committee

Run the code above in your browser using DataLab