is_url: Test if URL

is_urlR Documentation

Test if URL

Description

Tests whether the elements of a character vector are Uniform Resource Locators (URLs).

Usage

is_url(x)

Arguments

x

Character vector to test.

Details

This function is based on xml2::url_parse() and simply checks whether the elements in x contain both a scheme as well as some scheme-specific part (excl. ports). No further checks are performed, so it's explicitly not verified that a URL actually conforms to its respective scheme.

Value

A logical vector of the same length as x.

See Also

Other HTTP functions: is_http_success(), req_cached()

Examples

pal::is_url(c("/some/path",
              "file:///some/path"))

salim-b/pal documentation built on Feb. 28, 2025, 6:51 p.m.