Hi, I'm trying to install the NbClust R package from an Execute R Script block in Designer:
Code:
azureml_main <- function(dataframe1, dataframe2){
# Install required libraries
print("**** START: Installing required libraries ****")
install.packages("NbClust",repos = "http://cran.us.r-project.org")
library(NbClust)
print("**** END: Installing required libraries ****")
print("R script run.")
print(summary(dataframe1))
# If a zip file is connected to the third input port, it is
# unzipped under "./Script Bundle". This directory is added
# to sys.path.
# Return datasets as a Named List
return(list(dataset1=dataframe1, dataset2=dataframe2))
}
Error:
[1] "R script run."
[1] "Import packages."
Loading required package: reticulate
Loading required package: jsonlite
Loading required package: dplyr
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
[1] "R read input parquet file."
[1] "0 columns have been set to origin types."
[1] "**** START: Installing required libraries ****"
Warning: unable to access index for repository http://cran.us.r-project.org/src/contrib:
cannot open URL 'http://cran.us.r-project.org/src/contrib/PACKAGES'
Error in library(NbClust) : there is no package called ‘NbClust’
Calls: tryCatch ... tryCatchList -> withCallingHandlers -> azureml_main -> library
In addition: Warning message:
package ‘NbClust’ is not available (for R version 3.5.1)
Execution halted
The same "install.packages("NbClust",repos = "http://cran.us.r-project.org")
library(NbClust)" R code works just fine on my local computer.