download.file {base} | R Documentation |
This function can be used to download a file from the Internet either
using a helper application such as wget
or by making a direct
socket connection.
download.file(url, destfile, method = "auto", quiet=FALSE)
url |
A character string with the URL of a file to be downloaded. |
destfile |
A character string with the name where the downloaded file is saved. |
method |
Tool to be used for downloading files. Currently
download methods "auto" , "wget" , "lynx"
"cp" and "socket" are available. To use "wget"
or "lynx" the executable must be installed on your system and
in your path. To use "socket" the file must be on an
HTTP server, in plain text, and your system must allow socket
connections to be opened to that server. |
quiet |
If TRUE , suppress status messages from the download
tool (if any). |
The function download.file
can be used to download a single
file as described by url
from the internet and store it in
destfile
. It makes a system call to the tool given by
method
, the respective program must be installed on your system
and be in the search path for executables. If method "cp"
is
used, then the url
must start with "file:"
and give the
path to a local file. Method "auto"
(the default) searches for
available tools at runtime.
The url
must start with a type specification such as
"http://"
, "ftp://"
or "file:"
.
Cacheing proxies and firewalls may well not allow method "socket"
socket to be used.