| Title: | Run CRAN URL Checks from Older R Versions |
| Version: | 2.0.0 |
| Description: | Provide the URL checking tools available in R 4.1+ as a package for earlier versions of R. Also uses concurrent requests so can be much faster than the serial versions. |
| License: | GPL-3 |
| URL: | https://github.com/r-lib/urlchecker, https://urlchecker.r-lib.org/ |
| BugReports: | https://github.com/r-lib/urlchecker/issues |
| Depends: | R (≥ 4.1) |
| Imports: | cli, curl, gitcreds, rlang (≥ 1.1.0), tools, utils, xml2 |
| Suggests: | covr, testthat (≥ 3.0.0), webfakes, withr |
| Config/Needs/website: | tidyverse/tidytemplate |
| Config/testthat/edition: | 3 |
| Config/testthat/parallel: | true |
| Config/testthat/start-first: | url_check, qmd, url_update, print |
| Config/usethis/last-upkeep: | 2025-05-07 |
| Encoding: | UTF-8 |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-07-08 15:53:55 UTC; gaborcsardi |
| Author: | R Core team [aut] (The code in urltools.R adapted from the tools
package),
Jim Hester |
| Maintainer: | Gábor Csárdi <csardi.gabor@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-08 16:30:08 UTC |
urlchecker: Run CRAN URL Checks from Older R Versions
Description
Provide the URL checking tools available in R 4.1+ as a package for earlier versions of R. Also uses concurrent requests so can be much faster than the serial versions.
Author(s)
Maintainer: Gábor Csárdi csardi.gabor@gmail.com
Authors:
Gábor Csárdi csardi.gabor@gmail.com
R Core team (The code in urltools.R adapted from the tools package)
Jim Hester (ORCID)
Other contributors:
Posit Software, PBC (ROR) [copyright holder, funder]
See Also
Useful links:
Report bugs at https://github.com/r-lib/urlchecker/issues
Check urls in a package or project
Description
For an R package, runs the url_db_from_package_source function in the
tools package along with functions to check URLs in un-rendered Rmarkdown
(.Rmd) and Quarto (.qmd) vignettes and in BibTeX (.bib) bibliographies.
For non-package projects, URLs are extracted from all supported files found
in the given directories.
Usage
url_check(
path = ".",
db = NULL,
parallel = TRUE,
pool = curl::new_pool(),
progress = TRUE,
fail = TRUE
)
Arguments
path |
Path(s) to check. Each element may be:
|
db |
A url database |
parallel |
If |
pool |
A multi handle created by |
progress |
Whether to show the progress bar for parallel checks |
fail |
If |
Value
A url_checker_db object (invisibly). This is a check_url_db object
with an added class with a custom print method.
Ignoring URLs with .urlignore
Some URLs cannot be checked automatically, e.g. a link to a private
repository, or a page behind a login or captcha. To stop url_check() from
flagging (and even requesting) such URLs, list them in a .urlignore file.
It is read from two locations relative to the checked root, and the patterns
found are combined:
-
.urlignorein the root directory (like.gitignore), and -
tools/.urlignore(handy for packages that keep it undertools/).
Each non-empty line is a glob pattern (blank lines and lines starting with
# are ignored), matched against the whole URL. For example
https://github.com/acme/secret matches that URL exactly, while
https://github.com/acme/* matches every URL under that path. Matching URLs
are dropped before checking, so they are never requested.
Note that CRAN's own URL checks do not read .urlignore, so an ignored URL
may still be flagged when the package is submitted to CRAN.
Examples
## Not run:
url_check("my_pkg")
url_check(c("README.md", "docs"))
## End(Not run)
Update URLs in a package
Description
First uses url_check to check and then updates any URLs which are permanent (301) redirects.
Usage
url_update(path = ".", results = url_check(path, fail = FALSE))
Arguments
path |
Path to the package |
results |
results from url_check. |
Value
The results from url_check(path), invisibly.
Examples
## Not run:
url_update("my_pkg")
## End(Not run)