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

Name of object defined in x. Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause set.

Functions

  • isURL: Vectorized.

  • isAURL: Scalar. Requires a single URL.

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

Note

Updated 2019-08-10.

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: 1 failure #> pos value cause #> 1 1 xxx not URL
isAURL(urls)
#> [1] FALSE #> Cause: 'urls' does not have a length of 1.