Description Usage Arguments Value Functions
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.
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(...)
|
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 |
version |
The API version. |
response_type |
Response content type. One of |
as |
Passed to |
... |
Arguments passed to |
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. |
A pollster_api
object which is a list with elements
content
:The parsed content of the response,
url
:The URL of the request,
response
:The request object returned by GET
.
pollster_polls
: Get polls. See API docs.
pollster_polls_slug
: Get a single poll. See API docs.
pollster_questions
: Get questions. See API docs.
pollster_questions_slug
: Get a poll question. See API Docs.
pollster_questions_responses_clean
: Get a table where each row where each row is a single poll question + subpopulation and columns are response labels. See API Docs.
pollster_questions_responses_raw
: Get a table where each row is single poll question + subpopulation + response. See API Docs.
pollster_charts
: Return a list of charts. See hrefhttps://app.swaggerhub.com/swagger-ui/#!/default/get_chartsAPI Docs.
pollster_charts_slug
: Get a chart. See hrefhttps://app.swaggerhub.com/swagger-ui/#!/default/get_charts_slugAPI Docs.
pollster_charts_polls
: Get table with one row per poll used in a chart. See API Docs.
pollster_charts_trendlines
: Get table with the trendline estimates used in a chart. See API Docs.
pollster_tags
: Return the list of tags used in polls, questions, and charts. See API Docs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.