downloadFile.character
From R.utils v1.4.2
by Henrik Bengtsson
Downloads a file
Downloads a file.
- Keywords
- methods, file, programming
Usage
## S3 method for class 'character':
downloadFile(url, filename=basename(url), path=NULL, skip=TRUE, overwrite=!skip, ..., binary=TRUE, dropEmpty=TRUE, verbose=FALSE)
Arguments
- url
- A
character
string specifying the URL to be downloaded. - filename, path
- (optional)
character
strings specifying the local filename and the path of the downloaded file. - skip
- If
TRUE
, an already downloaded file is skipped. - overwrite
- If
TRUE
, an already downloaded file is overwritten, otherwise an error is thrown. - ...
- Additional arguments passed to
download.file
. - binary
- If
TRUE
, the file is downloaded exactly "as is", that is, byte by byte (strongly recommended). - dropEmpty
- If
TRUE
and the downloaded file is empty, the file is ignored andNULL
is returned. - verbose
- A
logical
,integer
, or aVerbose
object.
Value
- Returns the local pathname to the downloaded filename,
or
NULL
if no file was downloaded.
See Also
Internally download.file
is used.
That function may generate an empty file if the URL is not available.
Examples
pathname <- downloadFile("http://www.r-project.org/index.html", path="www.r-project.org/")
print(pathname)
Community examples
Looks like there are no examples yet.