Skip to contents

Does the input contain a URL?

Usage

isUrl(x)

isAUrl(x)

allAreUrls(x)

Arguments

x

Object.

Value

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

Details

This assert check is intended to be simple and does not check to see if the URL exists (is active). For that, refer to isExistingUrl instead.

Functions

  • isUrl(): Vectorized.

  • isAUrl(): Scalar. Requires a single URL.

  • allAreUrls(): Scalar. Checks that all strings are URLs.

Note

Updated 2023-10-06.

Examples

urls <- c("https://www.r-project.org/", "ftp://r-project.org/")

## TRUE ====
isUrl(urls)
#> [1] TRUE TRUE
isAUrl(urls[[1L]])
#> [1] TRUE
allAreUrls(urls)
#> [1] TRUE

## FALSE ====
isUrl("xxx")
#> [1] FALSE
isAUrl(urls)
#> [1] FALSE