dot-uri_path_packer: Divide, group and collapse uri paths.

.uri_path_packerR Documentation

Divide, group and collapse uri paths.

Description

Function creates groups of equal length with the last group containing any remainder.

Usage

.uri_path_packer(x, package_length = 25)

Arguments

x

Number or vector to cut and sequence.

package_length

Desired length of uri path package.

Details

Vector of paths is padded with NA values and passed to matrix for packaging.

Function is intended to create an indicies for tibbles.

The idea here is to reduce the number of calls to the API. The API will return a maximum response length of 25. This function helps create requests that will GET responses of length 25.

Example: if you pass 26 player_key's to 'y_player_stats()' the function will create 2 uri paths. One with the first 25 players and one for remaining player.

These paths are then passed to 'httr::build_url()'

Value

A numeric vector.


macraesdirtysocks/YFAR documentation built on March 20, 2022, 2:07 a.m.