View source: R/download.files.R
download.files | R Documentation |
Attempts to download files, given name(s) all from one specified url, saving them in specified folder.
Just a wrapper that Uses download.file()
since that only downloads a single file.
download.files(
url,
files,
destfiles,
todir,
silent = FALSE,
overwrite = FALSE,
...
)
url |
The url of folder with files to download, as character string, or a vector: If files is specified, url should be the one folder without the filename. Otherwise, a vector of full paths with filenames. |
files |
Optional. A character vector of file names to be found at url. If missing, assumes url is full path including filename. |
destfiles |
Optional. A character vector of one or more file names. If missing, it uses same names as in files at url. |
todir |
The folder where downloaded files will be placed, as a character string. |
silent |
Logical, optional, FALSE by default. Prints a message using cat() if TRUE. |
overwrite |
Optional, logical, FALSE by default. If FALSE, checks to see if file already exists in local folder and does not download if already exists. But note that may cause problems if zero size file exists already due to earlier failed download. |
... |
optional parameters passed to utils::download.file |
Returns vector of numbers, each being 1 or 0 or 2 to signify success or failure or no attempt because file already seems to exist locally.
Could recode to use the curl package, since curl::curl_download()
is a replacement for base download.file()
with better performance,
support for encryption (https, ftps), gzip compression, authentication, etc.
utils::download.file()
curl::curl_download()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.