Learn R Programming

accessrmd (version 1.0.0)

check_urls: Check an Rmarkdown for broken links.

Description

Check links within an Rmarkdown document for any urls that responds with an error.

Usage

check_urls(rmd_path)

Arguments

rmd_path

Path to the Rmd that requires links to be checked. Rmd must be output type html.

Value

Lines of any urls that respond with an error.

Examples

Run this code
# NOT RUN {
# create a testfile
links <- tempfile("mixed_links", fileext = ".rmd")
file.create(links)
writeLines("[a good link](https://datasciencecampus.ons.gov.uk/)
[a bad link](https://datasciencecampus.ons.gov.uk/broken)",
  con = links
)
# Test the file
check_urls(links)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab