我花了很多时间尝试解决这个问题,但还是没有成功。我正在尝试在Max OS X Lion上使用R 2.14.1和Rgraphviz。
以下是我安装和使用Rgraphviz的步骤:
1. 通过以下命令安装graphviz:
以下是我安装和使用Rgraphviz的步骤:
1. 通过以下命令安装graphviz:
sudo port install graphviz
2. 检查安装是否成功:pkg-config --modversion libgvc
,结果应该为2.28.0
,表示安装成功。
3. 在R 2.14.1下,运行以下命令安装Rgraphviz库:source("http://www.bioconductor.org/biocLite.R")
biocLite("Rgraphviz")
4. 每当我尝试使用该库时,都会出现以下错误。Error : .onLoad failed in loadNamespace() for 'Rgraphviz', details:
call: value[[3L]](cond)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so, 6): Library not loaded: /usr/local/lib/libgvc.5.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so
Check that (1) graphviz is installed on your system; (2) the installed version of
graphviz matches '2.26.3'; this is the version used to build this Rgraphviz
package; (3) graphviz is accessible to R, e.g., the path to the graphviz 'bin'
directory is in the system 'PATH' variable. See additional instructions in the
'README' file of the Rgraphviz 'source' distribution, available at
我注意到的一些事情
- "帮助"文件中建议使用的Graphviz版本是2.26.3,而Mac Ports安装的版本是2.28.0,但由于后者是更新的版本,我认为这没有影响,而且我找不到2.26.3版本。
- 建议(3)似乎是关键,但是我找不到/没有在Graphbiz下找到bin目录。
此外,当我运行locate Rgraphviz.so
时,没有结果。
如果您有任何解决方案的线索,将不胜感激,非常感谢!
dot -V
(dot
是安装graphviz时的可执行文件之一):它应该返回类似于dot - graphviz version 2.26.3 (20100126.1600)
的东西。 - Vincent Zoonekynddot - graphviz version 2.28.0 (20120119.1845)
,所以错误在于R。我还尝试在64位模式下运行R,但没有成功,仍然是同样的错误。 - JordanBelf