urltools {tools} | R Documentation |
Check Package URLs
Description
Check URLs in package sources.
Usage
check_package_urls(dir, verbose = FALSE)
parse_URI_reference(x)
Arguments
dir |
a character string specifying the path to a package's root source directory. |
verbose |
a logical indicating if output should monitor check progress. |
x |
a character vector of URIs. |
Details
Checking URLs is performed in parallel using curl (so this must be installed for checking).
The URLs checked are extracted from the package ‘DESCRIPTION’
(‘Description’, ‘URL’ and ‘BugReports’ fields), Rd,
‘CITATION’ and ‘NEWS.md’ files, if package xml2 is
installed also from the ‘.html’ files in ‘inst/doc’, and if
additionally pandoc
is available on the system the
‘README.md’ and ‘NEWS.md’ files.
For efficiency reasons, URLs are first checked using ‘HEAD’ requests, and the ones with non-OK (200) status codes re-checked via ‘GET’ requests (unfortunately, ‘HEAD’ requests are not always honored appropriately).
parse_URI_reference()
is a helper which splits URI references
into its scheme, authority, path, query and fragment parts.
See RFC 3986 (https://www.rfc-editor.org/rfc/rfc3986) for more
information.
Value
For check_url_db()
, a data frame inheriting from class
check_url_db
with information on the URL check problems found.
For parse_URI_reference()
, a data frame with character
variables scheme
, authority
, path
, query
and fragment
.
Note
This functionality is still experimental: interfaces may change in future versions.
Examples
## Examples from RFC 3986.
parse_URI_reference(c("foo://example.com:8042/over/there?name=ferret#nose",
"urn:example:animal:ferret:nose",
"mailto:John.Doe@example.com",
"tel:+1-816-555-1212"))