api_to_dataframe: Given a url submit the request and return the results as a...

View source: R/api_to_dataframe.R

api_to_dataframeR Documentation

Given a url submit the request and return the results as a dataframe.

Description

Given a url submit the request and return the results as a dataframe. If the response is paginated, the functions is called recursively until all of the pages have been loaded ($next is null). A maximum of 10 requests are made. If the maximum number of pages is reached, the function returns the data and issues a warning that there may be additional data and that the filters should be refined and multiple requests made and then combined to ensure that all of the records selected by the filter are returned.

Usage

api_to_dataframe(url, data = NULL, page = 0, recursive = TRUE)

Arguments

url

string

data

dataframe

page

number

recursive

boolean

Value

dataframe

Author(s)

Adam Cottrill adam.cottrill@ontario.ca


AdamCottrill/GLFishStockR documentation built on Sept. 3, 2022, 10:26 p.m.