pollster_api: Make Huffpost Poster API request

Description Usage Arguments Value Functions

View source: R/pollstr.R

Description

The function pollster_api is the lower-level function for making a request to the Huffpost Pollster API. There is also a function for each methods provided by the API.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pollster_api(path, query = NULL, version = "v2", response_type = NULL,
  as = "parsed", ...)

pollster_polls(cursor = NULL, tags = NULL, question = NULL,
  sort = c("created_at", "updated_at"), ...)

pollster_polls_slug(slug, ...)

pollster_questions(cursor = NULL, tags = NULL, election_date = NULL, ...)

pollster_questions_slug(slug, ...)

pollster_questions_responses_clean(slug, ...)

pollster_questions_responses_raw(slug, ...)

pollster_charts(cursor = NULL, tags = NULL, election_date = NULL, ...)

pollster_charts_slug(slug, ...)

pollster_charts_polls(slug, ...)

pollster_charts_trendlines(slug, ...)

pollster_tags(...)

Arguments

path

The API endpoint, as a character vector. If the length is greater than one, the elements will be collapsed and separated by "/".

query

Query parameters as a list.

version

The API version.

response_type

Response content type. One of "json", "tsv", or "xml". Some endpoints are json/xml, and some are tsv.

as

Passed to content.

...

Arguments passed to GET.

cursor

Special string used to handle pagination.

tags

Character vector of tag names.

question

Question slug.

sort

Sort order of polls.

slug

Unique identifier for the poll or question or chart.

election_date

A date object or a string in "YYYY-MM-DD" format for the election date.

Value

A pollster_api object which is a list with elements

Functions


rOpenGov/pollstR documentation built on May 26, 2019, 8:48 p.m.