I'm trying install and load some R packages in the Execute R Script in Azure Machine Learning for to run models, such as tidymodels, timetk, modeltime, modeltime.ensemble.
library(forecast)
library(tidyverse)
library(lubridate)
install.packages("quantdates",repos = "https://cloud.r-project.org")
install.packages("tidymodels",repos = "https://cloud.r-project.org")
library(quantdates)
library(tidymodels)
library(timetk)
library(modeltime)
library(modeltime.resample)
library(modeltime.ensemble)
However I get the following error:
Error: package or namespace load failed for ‘tidymodels’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.4.5 is already loaded, but >= 1.0.2 is required
azureml_main(input_dataframe_1), library(tidymodels), tryCatch({
attr(package, "LibPath") <- which.lib.loc
ns <- loadNamespace(package, lib.loc)
env <- attachNamespace(ns, pos = pos, deps)
}, error = function(e) {
P <- if (!is.null(cc <- conditionCall(e)))
paste(" in", deparse(cc)[1])
else ""
msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), P, conditionMessage(e))
if (logical.return)
message(paste("Error:", msg), domain = NA)
else stop(msg, call. = FALSE, domain = NA)
}), tryCatchList(expr, classes, parentenv, handlers), tryCatchOne(expr, names, parentenv, handlers[[1]]), value[[3]](cond), stop(msg, call. = FALSE, domain = NA), .handleSimpleError(function (e)
{
error_msg <<- paste(toString(e), toString(sys.calls()[-c(1:3)]), sep = "\n")
stop(e)
}, "package or namespace load failed for ‘tidymodels’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):\n namespace ‘rlang’ 0.4.5 is already loaded, but >= 1.0.2 is required", quote(NULL)), h(simpleError(msg, call))
'.
---------- End of error message from R interpreter ----------
I have also tried with devtools package for install a particular version but I keep getting the same error with the rlang package. Sometimes, I get the same error with the cli package.
In my local machine, the R code runs fine. I have the R version 4.1.3 and the Azure Machine Learning has the R version 3.5.1.
Does anyone know how I can solve this problem?