pollster_iter: Fetch multiple pages

Description Usage Arguments Value Functions

View source: R/pollstr.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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


pollstR documentation built on May 1, 2019, 10:09 p.m.