OSX上的R:ggraph安装错误 [英] R on OSX: ggraph install error

查看:328
本文介绍了OSX上的R:ggraph安装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从CRAN安装ggraph软件包

I'm trying to install ggraph package from CRAN

> 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版本,等等,问题仍然存在.

I already run brew install udunits, build from source, try with Github version, etc and the problem persists.

如何绕过/解决此问题?

How do I bypass/solve this problem?

推荐答案

这是代码中的错误.我对该错误提交了修复程序.如果您从该拉取请求进行安装,它将可以正常工作:

This is a bug in the code. I submitted a fix for the bug. If you install from that pull request, it should work:

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

这篇关于OSX上的R:ggraph安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆