Description Usage Arguments Value Author(s) References Examples
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.
1 | Committee.getCommitteesByTypeState(typeId=list("H","S","J"), stateId="NA", all=FALSE)
|
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) |
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.
Ulrich Matter <ulrich.matter-at-unibas.ch>
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.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.