Search code examples
rgithubcortana-intelligenceazure-machine-learning-service

How to import a third party library "causalImpact" using R script in AzureML studio?


I tried to import causalImpact library from github using "devtools" in AzureML studio for one of my projects. code used was:

library(devtools)
devtools::install_github("google/CausalImpact")

Unfortunately, Azure doesn't support this.So tried importing it following the procedure in this blog.It is giving multiple errors on the name of dependent packages of casualImpact(i.e. BOOM, BH etc.). Can anyone help me out in importing this package on Azure?

This is the R-script I used following the link given above:

library(assertthat)
library(dplyr)
library(hflights)
library(Lahman)
library(magrittr)
library(LGPL)
install.packages("src/BH_1.55.0-3.zip", lib = ".", repos = NULL, verbose = TRUE)
success <- library("BH ", lib.loc=".", logical.return = TRUE, verbose=TRUE)

library(BH)
install.packages("src/Boom_0.1.zip", lib = ".", repos = NULL, verbose = TRUE)
success <- library("Boom ", lib.loc=".", logical.return = TRUE, verbose=TRUE)

install.packages("src/BoomSpikeSlab.zip", lib = ".", repos = NULL, verbose = TRUE)
success <- library("BoomSpikeSlab", lib.loc=".", logical.return = TRUE, verbose=TRUE)

install.packages("src/bsts_0.5.1.zip", lib = ".", repos = NULL, verbose = TRUE)
success <- library("bsts", lib.loc=".", logical.return = TRUE, verbose=TRUE)
library(zoo)
library(xts)
install.packages("src/CausalImpact.zip", lib = ".", repos = NULL, verbose = TRUE)
success <- library("CausalImpact", lib.loc=".", logical.return = TRUE, verbose=TRUE)

Solution

  • You will have to upload all dependent packages of casualImpact as a zip file - see sample here which shows uploading two packages required for xgboost