pagination_helper: Pagination Management

pagination_helperR Documentation

Pagination Management

Description

Many of last.fm API responses are paginated with a page size maximum of 50. lastfmr provides a series of functions that help to deal with these pages.

End-users are not expected to interact with these functions directly in most cases since pagination is already taken into account when invoking the raw or tidy data request functions.

Note that some endpoints return pagination based on OpenSearch query results and information about next pages, etc. are stored in slightly different ways.

  • get_current_page() and get_total_pages() return the current page of a response and the total number of pages available, respectively.

  • has_next_page() checks if there are more pages after the current page.

Usage

get_current_page(resp)

get_total_pages(resp)

has_next_page(resp)

get_response_attr(resp)

Arguments

resp

lastfm object

Value

  • get_current_page() returns an integer

  • has_next_page() returns a boolean


bkkkk/lastfmr documentation built on Sept. 4, 2022, 7:03 a.m.