Zizzipupp
Zizzipupp

Reputation: 1361

R: unable to install AzureML package (R version 3.3.3)

I am attempting to install the AzureML package for R (version 3.3.3) in order to be able to run some R scripts in Microsoft PowerBI.

When I run install.packages("AzureML") in my console, I get the following errors:

> install.packages("AzureML")
Installing package into ‘C:/Users/MyName/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository https://mirrors.ustc.edu.cn/CRAN/src/contrib:
  cannot open URL 'https://mirrors.ustc.edu.cn/CRAN/src/contrib/PACKAGES'
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'
Error in readRDS(file) : 
  cannot read workspace version 3 written by R 3.6.2; need R 3.5.0 or newer
In addition: Warning message:
package ‘AzureML’ is not available (for R version 3.3.3) 
Warning: unable to access index for repository https://mirrors.ustc.edu.cn/CRAN/bin/windows/contrib/3.3:
  cannot open URL 'https://mirrors.ustc.edu.cn/CRAN/bin/windows/contrib/3.3/PACKAGES'
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.3:
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.3/PACKAGES'

I read somewhere that PowerBI does not support R versions >3.3.3, and that's why I am limiting myself to this one.

Also, I tried the same thing for other versions and I was always getting the message: package ‘AzureML’ is not available (for R version 3.x.y)

What am I doing wrong?

Upvotes: 1

Views: 437

Answers (1)

Zizzipupp
Zizzipupp

Reputation: 1361

The answer is: the AzureML package is not published to CRAN, so it could not be found.

The workaround to this is:

  1. Open PowerBI and go to File > Options and Settings > Options > R scripting > Detected R directories. This will tell you which version of R you are using;
  2. Launch that specific R version and type install.packages("devtools", type = "win.binary");
  3. And then, according to this source, type devtools::install_github("RevolutionAnalytics/AzureML");
  4. Then, head to C:\Users\YourUser\Documents\R\win-library\3.4, which is where all the packages may have been saved if you encountered an error saying that the library folder cannot be written to. Copy all packages in win-library\3.4 and paste them to C:\Program Files\R\R-3.4.4\library, which is the default location of the R library folder;
  5. Test that AzureML is correctly loaded by typing library("AzureML") in your R console;
  6. Head back to PowerBI and re-run the R script that uses AzureML. This time it should work.

Upvotes: 1

Related Questions