Does the input contain a URL?

isURL(x, .xname = getNameInParent(x))

isAURL(x, .xname = getNameInParent(x))

allAreURLs(x, .xname = getNameInParent(x))

Arguments

x

Object.

.xname

Not intended to be used directly.

Value

logical.

Functions

  • isURL: Vectorized.

  • isAURL: Scalar. Requires a single URL.

  • allAreURLs: Scalar. Checks that all strings are URLs.

Examples

urls <- c("https://www.r-project.org", "ftp://r-project.org") ## TRUE ==== isURL(urls)
#> https://www.r-project.org ftp://r-project.org #> TRUE TRUE
isAURL(urls[[1L]])
#> [1] TRUE
allAreURLs(urls)
#> [1] TRUE
## FALSE ==== isURL("xxx")
#> [1] FALSE #> Cause of failure: #> not URL
isAURL(urls)
#> [1] FALSE #> Cause of failure: #> urls is not a character of length 1.