url_exists: Returns whether the given URL is valid.

View source: R/url_exists.R

url_existsR Documentation

Returns whether the given URL is valid.

Description

This function was posted on StackOverflow here: https://stackoverflow.com/questions/52911812/check-if-url-exists-in-r

Usage

url_exists(x, non_2xx_return_value = FALSE, quiet = TRUE, ...)

Arguments

x

a single URL

non_2xx_return_value

what to do if the site exists but the HTTP status code is not in the '2xx' range. Default is to return 'FALSE'.

quiet

if not 'FALSE', then every time the 'non_2xx_return_value' condition arises a warning message will be displayed. Default is 'FALSE'.

...

other params ('timeout()' would be a good one) passed directly to 'httr::HEAD()' and/or 'httr::GET()'

Author(s)

hrbrmstr


jbryer/ipeds documentation built on Feb. 25, 2023, 1:53 a.m.