Check if an argument is a URL

assert_url(x)

Arguments

x

Object to check

Value

If the check is successful, x will be returned invisibly.

Examples

url <- "https://github.com/KoderKow/pathr"

assert_url(url)

# The following throws an error
url <- "ww.exampl.co/this/will/fail"

try(assert_url(url))