Downloads a file
Downloads a file.
## S3 method for class 'character': downloadFile(url, filename=basename(url), path=NULL, skip=TRUE, overwrite=!skip, ..., username=NULL, password=NULL, binary=TRUE, dropEmpty=TRUE, verbose=FALSE)
characterstring specifying the URL to be downloaded.
- filename, path
characterstrings specifying the local filename and the path of the downloaded file.
TRUE, an already downloaded file is skipped.
TRUE, an already downloaded file is overwritten, otherwise an error is thrown.
- Additional arguments passed to
- username, password
characterstrings specifying the username and password for authenticated downloads. The alternative is to specify these via the URL.
TRUE, the file is downloaded exactly "as is", that is, byte by byte (recommended).
TRUEand the downloaded file is empty, the file is ignored and
integer, or a
password are only used
for downloads via URL protocol 'https'. The 'https' protocol requires
that 'wget' is available on the system.
- Returns the local pathname to the downloaded filename,
NULLif no file was downloaded.
download.file is used.
That function may generate an empty file if the URL is not available.
pathname <- downloadFile("http://www.r-project.org/index.html", path="www.r-project.org/") print(pathname)