is_valid_url: Assert that a URL is complete and valid

Description Usage Arguments Details Value Examples

View source: R/internal_functions.R

Description

Assert that a URL is complete and valid

Usage

1
is_valid_url(string)

Arguments

string

(Character) A URL to check.

Details

The regex I use is "@stephenhay" from https://mathiasbynens.be/demo/url-regex because it's the shortest regex that matches every CRAN mirror at https://cran.r-project.org/mirrors.html.

Value

A logical value, TRUE if the URL is valid, FALSE if otherwise.

Examples

1
2
3
4
## Not run: 
is_valid_url("http://rstudio.com")

## End(Not run)

librarian documentation built on July 12, 2021, 5:07 p.m.