This function also should follow http redirects on all platforms, which is
something that does not happen by default when curl
is used, as on Mac
OS X.With Windows, it either uses the "wininet"
method (for R 3.2) or uses
the "internal"
method after first ensuring that setInternet2
,
is active (which tells R to use the internet2.dll
).
On other platforms, it will try to use libcurl
, wget
, then
curl
, and then lynx
to download the file. R 3.2 will typically
have the libcurl
method and for previous versions of R Linux platforms
will have wget
installed, and Mac OS X will have curl
.
Note that for many (perhaps most) types of files, you will want to use
mode="wb"
so that the file is downloaded in binary mode.