[R] What happened to Canada?

Morgan, Martin Martin.Morgan at roswellpark.org
Tue Nov 3 00:30:48 CET 2015

The first error, about 'unsupported scheme' is saying that you (your R) does not have SSL support (as you tracked down, the problem is trying to read the online repositories using https://, and the 'unsupported scheme' is https). The code then goes on and uses the snapshot of mirrors available at the time your R was installed by reading a local file.

Your R may be using the 'internal' method (which does not support https) or a libcurl without SSL support. I have

> capabilities()["libcurl"]   # ok, using libcurl

and my libcurl supports SSL

$ curl-config --features

I got SSL capability through the package

$ dpkg --get-selections |grep libcurl4
libcurl4-openssl-dev:amd64			install

Your R might have been compiled without libcurl  (depending on how you installed R and the libraries present at installation time), or with a libcurl that does not have SSL. In the mean time, you can quieten things (and live insecurely) with options(useHTTPS=FALSE).

There is some discussion in ?download.file for the `method` argument.

Martin Morgan
From: R-help [r-help-bounces at r-project.org] on behalf of Marc Schwartz [marc_schwartz at me.com]
Sent: Monday, November 02, 2015 6:09 PM
To: Rolf Turner
Cc: R-help
Subject: Re: [R] What happened to Canada?

> On Nov 2, 2015, at 4:36 PM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
> On 03/11/15 01:41, Marc Schwartz wrote:
>>> On Nov 2, 2015, at 6:00 AM, John Kane <jrkrideau at inbox.com> wrote:
>>> A rather silly question but I went to install a new package this
>>> morning and as usual a list of CRAN mirrors appeared but the
>>> Canadian ones had disappeared.
>>> Is this some peculiarity of my system (Ubuntu 14.10 with R version
>>> 3.2.2)  or a new policy for R?
>>> John Kane Kingston ON Canada
>> Hi John,
>> Presuming that the CRAN mirror list online is current, there do not
>> appear to be any CRAN mirrors in Canada which support secure HTTP
>> (HTTPS), which is now the default in 3.2.2.
>> See the announcement from August 14 (SIGNIFICANT USER-VISIBLE CHANGES
>> https://stat.ethz.ch/pipermail/r-announce/2015/000589.html
>> See ?chooseCRANmirror for more information.
>> When you get a list of mirrors to select, by default the top of the
>> list will include mirrors that support HTTPS. The last entry on the
>> list should be (HTTP mirrors). Click that and it will bring up a list
>> of additional mirrors, including Canadian locations, that support
>> HTTP.
> Out of idle curiosity I started playing around with this stuff and ran into a puzzling phenomenon.
> When I execute
>    chooseCRANmirror()
> I get an error message:
>> Error in download.file(url, destfile = f, quiet = TRUE) :
>>  unsupported URL scheme
> Nevertheless a menu appears, with "(HTTP mirrors)" at the bottom, just as you said.
> I don't understand why chooseCRANmirror() still works despite the error being thrown.
> Tracing through what chooseCRANmirror() does I reduced the problem to:
>    u <- "https://cran.r-project.org/CRAN_mirrors.csv"
>    download.file(u,destfile="junk")
> which throws the error
>> Error in download.file(u, destfile = "junk") : unsupported URL scheme
> If I replace the "https" in the url by "http" then things run without an error being thrown.
> There is no immediate problem for me, since I can install packages from CRAN OK, using my usual New Zealand mirror (which is an http mirror).
> If I try to use one of the https mirrors that are shown by chooseCRANmirror() (e.g. Austria) then I get a warning:
>> Warning: unable to access index for repository
>> https://cran.r-project.org/src/contrib
> and the install goes back to using the New Zealand mirror.
> So there seems to be something not quite right with my system or with my installation of R.  Although, as I said, there is no immediate problem, the fact that something is not quite right worries me.
> Can you (Marc) or anyone else suggest what might be the problem and how to fix it, or at least track it down a bit more explicitly?
> Here's my


> Ta.
> cheers,
> Rolf


What do:




Is there any chance that you have something set in ~/.Rprofile pertaining to CRAN mirrors or are loading some packages that might conflict?

I would try it with a vanilla R session (e.g. 'R --vanilla').

If it works then, there is something getting loaded or set at session start that may be conflicting.

Here is my default sessionInfo() when I first start R from the CLI:

R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.1 (El Capitan)

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods
[7] base



R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

This email message may contain legally privileged and/or confidential information.  If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited.  If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.

More information about the R-help mailing list