[R-pkg-devel] download.file and https
Paul Gilbert
pgilbert902 at gmail.com
Fri Jul 3 16:24:57 CEST 2015
The difficulty with most workarounds suggested so far is the expanded
list of dependencies. My package and quantmod, have had a simple
dependency on download.file in utils. Picking on Dirks suggestion as an
example, it would add a system dependency on libcurl and an R package
dependency on curl, which in turn has system dependencies libcurl-devel
(rpm) or libcurl4-openssl-dev (deb). Furthermore, it suggests testthat,
knitr, jsonlite, rmarkdown, and magrittr, which means that these and
their dependencies, imports, and suggests all need to be installed and
working in order for me to test, and working with R-devel for me to
submit to CRAN.
Let me mention again that this problem is not specific to my package or
quantmod. It will be quickly affecting everyone that downloads from US
government websites, not to mention that other governments and
commercial web sites may start doing the same thing.
Paul
On 07/03/2015 06:39 AM, Dirk Eddelbuettel wrote:
>
> In random, I do the following, using R 3.2.0 or later with libcurl where
> installed, and Jeroen's lightweight curl::curl otherwise.
>
>
> getConnection <- function(urltxt, ...) {
> if (getRversion() >= "3.2.0" && capabilities()["libcurl"]) {
> url(urltxt, ..., method="libcurl")
> } else {
> curl(urltxt, ...)
> }
> }
>
> closeConnection <- function(con) {
> if (getRversion() >= "3.2.0" && capabilities()["libcurl"]) {
> close(con)
> } else {
> ## nothing to be done for curl()
> }
> }
>
>
> Hth, Dirk
>
More information about the R-package-devel
mailing list