if (FALSE) {
# Download a CSV file from GitHub:
download_url(
url = "https://raw.githubusercontent.com/tidyverse/ggplot2/main/README.md",
dest = file.path(tempdir(), "ggplot2_readme.md"),
timeout = 30
)
# Download and extract a zip file:
download_url(
url = "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.8.0.tar.gz",
dest = file.path(tempdir(), "dplyr.tar.gz"),
unzip = TRUE,
timeout = 60
)
}
# \donttest{
# Quick demo with a tiny file:
download_url(
url = "https://httpbin.org/robots.txt",
dest = file.path(tempdir(), "robots.txt"),
timeout = 10,
verbose = FALSE
)
# }
Run the code above in your browser using DataLab