MARCDataAPI_read: Download Data from MARCDataAPI

View source: R/MARCDataAPI.R

MARCDataAPI_readR Documentation

Download Data from MARCDataAPI

Description

[Stable]

Creates a GET request for a MARCDataAPI URL and returns the result as a tibble

Usage

MARCDataAPI_read(url, query = NULL)

Arguments

url

A url to a MARCDataAPI.

query

A list of key-values for queries to append to the GET request URL. Currently untested.

Details

See https://rpubs.com/ankc/480665 for how query should work theoretically.

Value

OBDC connection object returned from DBI::dbConnect()

Creation notes

First created in 2020-12-30 for easily accessing data distributed by the MARCData API.

Author(s)

Jacob Peterson

Examples

## Not run: 
df <- MARCDataAPI_read('https://gis2.marc2.org/MARCDataAPI/api/covidcasedeathtest') %>% 
  dplyr::mutate(Date = as.Date(Date),
                LastUpdated = lubridate::as_datetime(LastUpdated),
                LastUpdated = lubridate::with_tz(LastUpdated, "America/Chicago")) 
df

## End(Not run)

MARC-KC/marcR documentation built on June 2, 2022, 9:31 p.m.