Learn R Programming

pvsR (version 0.3)

getAllCounties: Get basic data on all counties

Description

This function is essentially a wrapper around Local.getCounties().

Usage

getAllCounties()

Arguments

Value

  • A data frame with a row for each county and columns with the following variables describing the county: counties.county*.localId, counties.county*.name, counties.county*.url.

References

http://api.votesmart.org/docs/Local.html Use State.getStateIDs() to get a list of state IDs.

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 a list of all counties
counties <- getAllCounties()
head(counties)

Run the code above in your browser using DataLab