2017-07-21 75 views
1

我試圖從CRAN安裝ggraphR於OSX:GGRAPH安裝錯誤

> install.packages("ggraph") 

這是輸出

Installing package into ‘/usr/local/lib/R/3.4/site-library’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.rstudio.com/src/contrib/ggraph_1.0.0.tar.gz' 
Content type 'application/x-gzip' length 2628485 bytes (2.5 MB) 
================================================== 
downloaded 2.5 MB 

* installing *source* package ‘ggraph’ ... 
** package ‘ggraph’ successfully unpacked and MD5 sums checked 
** libs 
/usr/local/opt/llvm/bin/clang++ -I/usr/local/Cellar/r/3.4.1_1/R.framework/Resources/include -DNDEBUG -I"/usr/local/lib/R/3.4/site-library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe -c RcppExports.cpp -o RcppExports.o 
/usr/local/opt/llvm/bin/clang++ -I/usr/local/Cellar/r/3.4.1_1/R.framework/Resources/include -DNDEBUG -I"/usr/local/lib/R/3.4/site-library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fPIC -g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe -c circlePack.cpp -o circlePack.o 
circlePack.cpp:447:58: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list [-Wc++11-narrowing] 
     Circle c = {0, 0, std::sqrt(float(*itr/M_PI)), circles.size() + 1}; 
                 ^~~~~~~~~~~~~~~~~~ 
circlePack.cpp:447:58: note: insert an explicit cast to silence this issue 
     Circle c = {0, 0, std::sqrt(float(*itr/M_PI)), circles.size() + 1}; 
                 ^~~~~~~~~~~~~~~~~~ 
                 static_cast<int>() 
1 error generated. 
make: *** [circlePack.o] Error 1 
ERROR: compilation failed for package ‘ggraph’ 
* removing ‘/usr/local/lib/R/3.4/site-library/ggraph’ 
Warning in install.packages : 
    installation of package ‘ggraph’ had non-zero exit status 

我已經運行brew install udunits,從源代碼編譯,嘗試用Github上版本等,問題依然存在。

如何繞過/解決此問題?

回答

1

這是代碼中的一個錯誤。我爲submitted a fix的錯誤。如果您從該請求安裝,它應該可以工作:

devtools::install_github("thomasp85/ggraph#78")