Search code examples
azureggplot2zipazure-machine-learning-service

Package usage in AzureML: ggplot2 and ggrepel


I have a code in Azure ML which uses the function ggrepel. That function requires the version 2.0.0 of the package ggplot2. When I try to use it I obtain the error:

Error 0063: The following error occurred during evaluation of R script:
---------- Start of error message from R ----------
package 'ggplot2' 1.0.0 was found, but >= 2.0.0 is required by 'ggrepel'

So, what I did was:

  1. updated the R package ggplot2 of my local version (is there a command to use to check the version of a package?);
  2. taken the folder related to ggplot2, and put it in the zip file I pass to Azure. So the x.zip wil contain generic functions, then ggrepel.zip and ggplot2.zip.

At the end I have written:

install.packages("src/ggplot2.zip",lib = ".", repos = NULL, verbose = TRUE)
install.packages("src/ggrepel.zip",lib = ".", repos = NULL, verbose = TRUE)
library(ggrepel, lib.loc=".", verbose=TRUE)
library(ggplot2, lib.loc=".", verbose=TRUE)

It seems working for ggrepel, but not for ggplot, because I obtain the same issue shown at the beginning. It's like the system does not see the updated package, but the default ggplot2 of Azure ML.


Solution

  • At the end I have solved adding an additional package. The problem is in the fact that you have to check the log of the error and not only the error output (that does not insert all you need). At the end I have solved in this way:

    install.packages("src/scales_0.4.0.zip" ,lib = ".", repos = NULL, verbose = TRUE)
    install.packages("src/ggplot2_2.1.0.zip",lib = ".", repos = NULL, verbose = TRUE)
    install.packages("src/ggrepel.zip"      ,lib = ".", repos = NULL, verbose = TRUE)
    
    library(scales,  lib.loc=".", verbose=TRUE)
    library(ggplot2, lib.loc=".", verbose=TRUE)
    library(ggrepel, lib.loc=".", verbose=TRUE)
    ...