r - ggraph 安装的问题

标签 r installation ggraph

我在安装 ggraph 时遇到了一些问题,我尝试了不同的方法,例如:How to install GGRAPH package to the latest R (v.3.3.2) 或者 R on OSX: ggraph install error .

我已经安装了 igraph 和 ggforce 包

但安装不成功,我收到如下错误消息:

devtools::install_github("thomasp85/ggraph#78", dependencies=TRUE)
Downloading GitHub repo klmr/ggraph@fix-narrowing-conversion
from URL https://api.github.com/repos/klmr/ggraph/zipball/fix-narrowing-conversion
Installing ggraph
versuche URL 'https://cran.rstudio.com/src/contrib/igraph_1.1.2.tar.gz'
Content type 'application/x-gzip' length 3376958 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

Installing igraph
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/tmp/Rtmp66ifdk/devtools34415beb6487/igraph' --library='/home/knecht/R/x86_64-pc-linux-gnu-library/3.4'  \
  --install-tests 

* installing *source* package ‘igraph’ ...
** Paket ‘igraph’ erfolgreich entpackt und MD5 Summen überprüft
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for rintf... yes
checking for finite... yes
checking for expm1... yes
checking for rint... yes
checking for log2... yes
checking for logbl... yes
checking for snprintf... yes
checking for log1p... yes
checking for round... yes
checking for fmin... yes
checking for stpcpy... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether stpcpy is declared... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking net/if.h usability... yes
checking net/if.h presence... yes
checking for net/if.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking net/if_dl.h usability... no
checking net/if_dl.h presence... no
checking for net/if_dl.h... no
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking for struct sockaddr.sa_len... no
checking for xml2-config... none
checking for __gmpz_add in -lgmp... no
configure: creating ./config.status
config.status: creating src/Makevars.tmp
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
gfortran   -fpic  -g -O2 -fstack-protector-strong  -c AMD/Source/amd.f -o AMD/Source/amd.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c AMD/Source/amd_1.c -o AMD/Source/amd_1.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c AMD/Source/amd_2.c -o AMD/Source/amd_2.o
…
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c foreign-gml-lexer.c -o foreign-gml-lexer.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c foreign-gml-parser.c -o foreign-gml-parser.o
In file included from src/foreign-gml-parser.y:59:0:
igraph_hacks_internal.h:42:0: warning: "strdup" redefined
 #  define strdup igraph_i_strdup
 ^
In file included from /usr/include/string.h:630:0,
                 from src/foreign-gml-parser.y:54:
/usr/include/x86_64-linux-gnu/bits/string2.h:1291:0: note: this is the location of the previous definition
 #   define strdup(s) __strdup (s)
 ^
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c foreign-graphml.c -o foreign-graphml.o
foreign-graphml.c: In function ‘igraph_write_graph_graphml’:
foreign-graphml.c:1408:46: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "<graphml xmlns=\"" GRAPHML_NAMESPACE_URI "\"\n");
                                              ^
foreign-graphml.c:1412:59: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "         xsi:schemaLocation=\"" GRAPHML_NAMESPACE_URI "\n");
                                                           ^
foreign-graphml.c:1414:38: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "         " GRAPHML_NAMESPACE_URI "/1.0/graphml.xsd\">\n");
                                      ^
/usr/lib/R/etc/Makeconf:159: die Regel für Ziel „foreign-graphml.o“ scheiterte
make: *** [foreign-graphml.o] Fehler 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/igraph’
Installation failed: Command failed (1)
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/tmp/Rtmp66ifdk/devtools344115aec704/klmr-ggraph-81327aa'  \
  --library='/home/knecht/R/x86_64-pc-linux-gnu-library/3.4' --install-tests 

* installing *source* package ‘ggraph’ ...
** libs
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c circlePack.cpp -o circlePack.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c iciclePlot.cpp -o iciclePlot.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c lineCutter.cpp -o lineCutter.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c pathAttr.cpp -o pathAttr.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c treemap.cpp -o treemap.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o ggraph.so RcppExports.o circlePack.o iciclePlot.o init.o lineCutter.o pathAttr.o treemap.o -L/usr/lib/R/lib -lR
installing to /home/knecht/R/x86_64-pc-linux-gnu-library/3.4/ggraph/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘igraph’ 0.7.1 is being loaded, but >= 1.0.0 is required
ERROR: lazy loading failed for package ‘ggraph’
* removing ‘/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/ggraph’
Installation failed: Command failed (1)

最佳答案

我刚刚遇到了类似的问题。我想问问题,但我超出了问题的限制:)。

在选择工具 -> 在 R Studio 中检查包更新(包 -> 更新数据包... 在 R 中),我点击了全选 并更新了我所有的包。然后我关闭计算机并重新启动并重复安装“ggraph”包的命令。没有问题。 “ggraph”数据包加载需要一些时间,但屏幕上不再显示“failed”。我希望这会有用。

关于r - ggraph 安装的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47376273/

相关文章:

r - 分组并在 R 中运行多个 t 测试

编辑文件时 Rstudio rsession 挂起

c# - 构建一个可以使用多种配置多次安装相同包(到不同文件夹)的安装程序

linux - 在 Linux : E: The "https://download.docker.com/linux/ubuntu una Release" repository does not have a Release file 上安装 Docker 时出现问题

r - knitr R markdown文档中的mapview错误

r - 如何在单个 ggplot2 中对齐图层(密度图和垂直线)

ubuntu - 在 Ubuntu : $HADOOP_HOME or $HADOOP_PREFIX must be set or hadoop must be in the 上安装 Hive 的问题

r - ggraph网络图: specify node coordinates

r - ggraph中相同网络的不同布局之间的平滑过渡

r - 如何在r中的ggraph网络中按权重调整边的宽度