Learn R Programming

pvsR (version 0.3)

getAllCities: Get basic data on all cities

Description

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

Usage

getAllCities()

Arguments

Value

  • A data frame with a row for each city and columns with the following variables describing the city: cities.city*.localId, cities.city*.name, cities.city*.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 cities
cities <- getAllCities()
head(cities)

Run the code above in your browser using DataLab