2016-06-14 51 views
0

我在Azure ML中使用函數ggrepel中的代碼。該功能需要軟件包ggplot2的版本2.0.0。當我嘗試使用它,我得到錯誤:AzureML中的軟件包使用情況:ggplot2和ggrepel

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' 

所以,我所做的就是:

  1. 更新我的本地版本將R包ggplot2(有用來檢查一個命令包的版本?);
  2. 取得了與ggplot2相關的文件夾,並將其放入我傳遞給Azure的zip文件中。因此,x.zip將包含泛型函數,然後是ggrepel.zip和ggplot2.zip。

最後我寫了:

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) 

它似乎工作ggrepel,而不是ggplot,因爲我獲得的開頭顯示的同樣的問題。這就像系統沒有看到更新的軟件包,但是Azure ML的默認ggplot2。

回答

0

最後我已經解決了添加一個額外的包。問題在於,您必須檢查錯誤的日誌,而不僅僅是錯誤輸出(不會插入所有您需要的)。最後我用這種方式解決了:

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) 
... 
相關問題