Skip to contents

Thin bridge to rmoriebricklayer::friendly_download(): downloads url to target_path, falling back to the archived Wayback snapshot if the live source is unreachable – useful for pinned open-data sources (e.g. the OTIS "Data on Inmates in Ontario" releases) that may move or change upstream.

Usage

morie_download(url, target_path, attempt_wayback = NULL)

Arguments

url

Live source URL.

target_path

Destination file path.

attempt_wayback

Logical or NULL; whether to fall back to the Wayback snapshot when the live fetch fails (passed through to bricklayer; NULL uses the bricklayer default).

Value

The downloaded path, per rmoriebricklayer::friendly_download().

Examples

# \donttest{
morie_download(
  "https://data.ontario.ca/dataset/data-on-inmates-in-ontario",
  tempfile(fileext = ".html"))
#> [1] TRUE
# }