test_url: Download file in a graceful way

View source: R/has_internet.R

test_urlR Documentation

Download file in a graceful way

Description

Function for downloading & testing url/internet connection according to CRAN policy Example solution strongly based on https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199/12 as suggested by kvasilopoulos

Usage

test_url(link, output, quiet = FALSE)

Arguments

link

character vector with URL to check

output

character vector for output file name

quiet

logical vector (TRUE or FALSE) to be passed to curl_download function. FALSE by default

Value

No return value, called for side effects to check for internet connection

Examples


 link = "http://httpbin.org/status/200"
 output = tempfile()
 test_url(link = link, output = output)



thunder documentation built on Nov. 11, 2023, 9:06 a.m.