Learn R Programming

librarian (version 1.8.1)

is_valid_url: Assert that a URL is complete and valid

Description

Assert that a URL is complete and valid

Usage

is_valid_url(string)

Arguments

string

(Character) A URL to check.

Value

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

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.

Examples

Run this code
# NOT RUN {
is_valid_url("http://rstudio.com")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab