nhl_from_json: Get URL using 'fromJSON'

Description Usage Arguments Value

View source: R/nhl_get_data.R

Description

Get URL using fromJSON

Usage

1
2
3
4
5
6
7
8
nhl_from_json(
  url,
  flatten = getOption("nhlapi_flatten"),
  silent = getOption("nhlapi_try_silent"),
  retries = getOption("nhlapi_get_retries"),
  retrySleep = getOption("nhlapi_get_retry_sleep"),
  noRetryPatt = getOption("nhlapi_get_noretry")
)

Arguments

url

character(1), the URL to get the data from.

flatten

logical(1), if TRUE (default) automatically flattens nested data frames into a single non-nested data frame.

silent

logical(1), passed to [try()].

retries

integer(1), number of retries in case of failed data retrieval (0L for no no retries).

retrySleep

integer(1), number of seconds to [Sys.sleep()] in between retries.

noRetryPatt

character(1), string pattern. If the error condition's message contains this pattern, there will be no retries. Useful for e.g. 404 returns where retries are likely useless.

Value

list, retrieved data if succeeded, a try-error class object otherwise.


nhlapi documentation built on Feb. 20, 2021, 9:06 a.m.