pollstR (version 2.0.1)

pollster_iter: Fetch multiple pages

Description

For Pollster methods that return results in pages (those with a cursor argument), iterate over multiple pages.

Usage

pollster_iter(.f, ..., cursor = NULL, .max_pages = 1, .debug = FALSE)

pollster_charts_iter(cursor = NULL, tags = NULL, election_date = NULL, .max_pages = 1, ...)

pollster_questions_iter(cursor = NULL, tags = NULL, election_date = NULL, .max_pages = 1, ...)

pollster_polls_iter(cursor = NULL, tags = NULL, question = NULL, sort = c("created_at", "updated_at"), .max_pages = 1, ...)

Arguments

.f

A pollster function for an endpoint that uses a cursor.

...

Arguments for .f

cursor

Special string used to handle pagination.

.max_pages

The maximum number of pages to fetch.

.debug

If TRUE prints the url and cursor number while fetching the pages.

tags

Character vector of tag names.

election_date

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

question

Question slug.

sort

Sort order of polls.

Value

A list of the results.

Functions

  • pollster_charts_iter: Return a list of charts. See hrefhttps://app.swaggerhub.com/swagger-ui/#!/default/get_chartsAPI Docs. This is the paginated version of pollster_charts.

  • pollster_questions_iter: Get a question. This is the paginated form of pollster_questions.

  • pollster_polls_iter: Get polls. This function is the paginated version of pollster_polls.