Committee.getCommitteesByTypeState: Get a list of committees according to type and state

Description Usage Arguments Value Author(s) References Examples

Description

This function is a wrapper for the Committee.getCommitteesByTypeState() method of the PVS API Committee class which returns a list of committees for each type in each requested state. The function sends a request with this method to the PVS API for all type and state 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
Committee.getCommitteesByTypeState(typeId=list("H","S","J"), stateId="NA", all=FALSE)

Arguments

typeId

(optional) a character string or list of character strings with the type ID(s) (default: All) (see references for details)

stateId

(optional) a character string or list of character strings with the state ID(s) (default: "NA", for national) (see references for details)

all

a logical indicator; if TRUE data on all possible combinations of the input variables are returned, if FALSE (default) only the exact combinations of them (see example)

Value

A data frame with a row for each committee and columns with the following variables describing the committee:
committees.committee*.committeeId,
committees.committee*.parentId,
committees.committee*.stateId,
committees.committee*.committeeTypeId,
committees.committee*.name.

Author(s)

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

References

http://api.votesmart.org/docs/Committee.html|cr See http://api.votesmart.org/docs/semi-static.html for a list of committee-type ID(s).
Use State.getStateIDs() to get a list of state IDs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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 data frame of committees according to all type/state combinations
## Not run: committees <- Committee.getCommitteesByTypeState(typeId=list("H","S"),
stateId=list("NY","NJ"), all=TRUE)
## End(Not run)
## Not run: committees
# get a data frame of committees according to the exact type/state combinations
# (i.e., "H"/"NY", "S"/"NJ")
## Not run: committees <- Committee.getCommitteesByTypeState(typeId=list("H","S"),
stateId=list("NY","NJ"), all=FALSE)
## End(Not run)
## Not run: committees

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