If method = "auto" is chosen (the default), the behavior depends on the platform:
On a Unix-alike method "libcurl" is used except "internal" for file:// URLs, where "libcurl" uses the library of that name (https://curl.se/libcurl/).
On Windows the "wininet" method is used apart from for ftps\:// URLs where "libcurl" is tried. The "wininet" method uses the WinINet functions (part of the OS).
Support for method "libcurl" is optional on Windows: use capabilities("libcurl") to see if it is supported on your build. It uses an external library of that name (https://curl.se/libcurl/) against which R can be compiled.
关于 download.file 的几点理解和值得注意的地方:
download.file 是来源于 R 自带的 utils 包的一个函数,使用 packageVersion("utils") 可以查看该包的版本。
在 windows 中,默认使用 "wininet" 的方法,对于 ftps\:// 的资源会尝试使用 "libcurl" 的下载方法。
Method to be used for downloading files. Current download methods are "internal", "wininet" (Windows only) "libcurl", "wget" and "curl", and there is a value "auto" .