This function is essentially a wrapper around
District.getByOfficeState().
Usage
getAllDistricts()
Arguments
Value
A data frame with a row for each district and columns with
the following variables describing the district:
districtList.district*.districtId,
districtList.district*.name,
districtList.district*.officeId,
districtList.district*.stateId.
References
http://api.votesmart.org/docs/District.html
See
http://api.votesmart.org/docs/semi-static.html for a list
of office IDs or use Office.getOfficesByType(),
Office.getOfficesByLevel(), Office.getOfficesByTypeLevel()
or Office.getOfficesByBranchLevel().
Use
State.getStateIDs() to get a list of state IDs.
# 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 all districtsdistricts <- getAllDistricts()
head(districts)