Learn R Programming

pollstR (version 1.0.2)

pollstr_charts: Get list of available charts

Description

Get list of available charts

Usage

pollstr_charts(topic = NULL, state = NULL, convert = TRUE)

Arguments

state
Only include charts from a single state. Use 2-letter state abbreviations. "US" will return all national charts.
topic
Only include charts related to a specific topic. See http://elections.huffingtonpost.com/pollstero/api for examples.
convert
Rearrange the data returned by the API into easier to use data frames.

Value

  • If convert=TRUE, a "pollstr_charts" object with elements [object Object],[object Object] Otherwise, a "list" in the original structure of the json returned by the API.

Examples

Run this code
# Get charts related to Minnesota
 mn <- pollstr_charts(state='MN')
 # Get charts in the topic '2013-governor'
 gov <- pollstr_charts(topic='2013-governor')
 # Get all charts
 allcharts <- pollstr_charts()

Run the code above in your browser using DataLab