View source: R/FetchFunctions.R
fetchUSGSTiles | R Documentation |
Download one or more files (usually lidar data tiles) described by a list of URLs and place them in a folder.
fetchUSGSTiles(destfolder = "", urls, refresh = FALSE, method = "libcurl", ...)
destfolder |
A character string with the name of the folder where the downloaded tiles should be saved. If empty, tiles are saved in the current working directory. The folder name should not include a trailing slash. The folder will be created if it does not exist. |
urls |
A list of character strings with the URLs for tiles to fetch. |
refresh |
Logical value indicating files that already exist in
|
method |
Method used with download.file() |
... |
Additional arguments passed to download.file() |
When retrieving large files, it may be necessary to increase the timeout period so downloads can complete. This is done using the following line of code (sets timeout to 5000 seconds):
options(timeout = max(5000, getOption("timeout")))
An (invisible) atomic vector of integer codes corresponding to the
urls
. The values are those returned from the download.file
function calls for each of the urls
, 0 for success and non-zero
for failure. You can easily count the number of urls
successfully
fetched using sum(value == 0, na.rm = TRUE)
.
## Not run:
fetchUSGSTiles("", URLlist)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.