View source: R/utils-valid-url.R
is_valid_url | R Documentation |
This function validates a URL by checking the presence of a scheme and a hostname in the parsed URL.
is_valid_url(url)
url |
A character string representing the URL to be checked. |
The function uses the httr2::url_parse
function to parse the URL
and checks if the parsed URL contains a scheme and a hostname. If either
is missing, the URL is considered invalid.
A logical value: TRUE
if the URL is valid, FALSE
otherwise.
Steven P. Sanderson II, MPH
is_valid_url("https://www.example.com") # TRUE
is_valid_url("not_a_url") # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.