[R] What happened to Canada?

Marc Schwartz marc_schwartz at me.com
Tue Nov 3 00:09:14 CET 2015


> 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
>> and NEW FEATURES):
>> 
>> 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

<snip>

> 
> 
> Ta.
> 
> cheers,
> 
> Rolf


Rolf,

What do:

  getOption("CRAN")

  getOption("repos")

show?

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)

locale:
[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     


Regards,

Marc



More information about the R-help mailing list