Is object a URL?

is_url(x)

Arguments

x

Object to be tested.

Value

Logical.

  • TRUE: all elements in the object are URLs.

  • FALSE: all elements in the object are not URLs

Examples

# The following returns TRUE
url <- "https://github.com/KoderKow/pathr"

is_url(url)
#> [1] TRUE

# The following returns FALSE
url <- "ww.exampl.co/this/will/fail"

try(assert_url(url))