Correct CRAN mirror error in RStudio when installed after SQL Server 2016’s Revolution Analytics RRO for RRE 7.5.0

By | January 31, 2016

I finally got around to installing SQL Server 2016 CTP 3.0 and was excited to see how R could integrate with the product. If you haven’t done so yet and would like to explore the new R features yourself, you can find very detailed instructions in the following links.

  1. Introducing Microsoft R Server (SQL Server 2016 R Services): //henkvandervalk.com/introducing-microsoft-sql-server-2016-r-services
  2. Installing SQL Server R Services: //msdn.microsoft.com/en-us/library/mt604883.aspx
  3. Post-Installation Server Configuration (SQL Server R Services): //msdn.microsoft.com/en-us/library/mt590536.aspx

One thing I did want to do outside of these instructions is to install RStudio Desktop as the IDE just for comfort-ability, look, and feel. However once I opened RStudio, I noticed an error indicating the CRAN mirror was set to an insecure URL. The URL in question was from the Revolution Analytics installation.RStudioCranMirrorError

WARNING: Your CRAN mirror is set to “//cran.revolutionanalytics.com/” which has an insecure (non-HTTPS) URL. The repository was likely specified in .Rprofile or Rprofile.site so if you wish to change it you may need to edit one of those files. You should either switch to a repository that supports HTTPS or change your RStudio options to not require HTTPS downloads.

To learn more and/or disable this warning message see the “Use secure download method for HTTP” option in Tools -> Global Options -> Packages.

 

A quick update to the RProfile.site file will correct this.

1: Locate the RProfile.site file located in “C:\Program Files\RRO\RRO-3.2.2-for-RRE-7.5.0\R-3.2.2\etc”.

2: Locate the block of code for “# set a CRAN mirror”.

 # set a CRAN mirror
 r <- getOption("repos")
 if (!identical(system.file(package="RevoScaleR"),"")) {
 if (.Platform$OS.type == "windows"){
 r["CRAN"] <- RevoUtils::getRevoRepos(CRANmirror=TRUE)
 } else {
 r <- c(REVO=RevoUtils::getRevoRepos())
 }
 } else {
 r["CRAN"] <- RevoUtils::getRevoRepos(MRANmirror=TRUE)
 }
 options(repos=r)	

3: Update with the following additional and commented lines.

  
 # set a CRAN mirror
 r <- getOption("repos")
 r["CRAN"] <- "//cran.revolutionanalytics.com/"
 # if (!identical(system.file(package="RevoScaleR"),"")) {
 # if (.Platform$OS.type == "windows"){
 # r["CRAN"] <- RevoUtils::getRevoRepos(CRANmirror=TRUE)
 # } else {
 # r <- c(REVO=RevoUtils::getRevoRepos())
 # }
 #} else {
 # r["CRAN"] <- RevoUtils::getRevoRepos(MRANmirror=TRUE)
 #}
 options(repos=r)

This will correct the RStudio error.

Leave a Reply

Your email address will not be published. Required fields are marked *