check-vector-isUrl: Does the input contain a URL?

check-vector-isUrlR Documentation

Does the input contain a URL?

Description

Does the input contain a URL?

Usage

isUrl(x)

isAUrl(x)

allAreUrls(x)

Arguments

x

Object.

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.

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 2023-10-06.

Examples

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

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

## FALSE ====
isUrl("xxx")
isAUrl(urls)

steinbaugh/goalie documentation built on Jan. 17, 2024, 5:16 p.m.