rugarch 不会加载,但可以安装得很好(在 mac 上)

标签 r installation-package

我在加载 rugarch 时遇到问题。我可以安装它没问题

install.packages('rugarch')

但是,当我尝试加载它时,出现错误
library(rugarch)
Error : .onLoad failed in loadNamespace() for 'rgl', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so
  Reason: image not found
Error: package or namespace load failed for ‘rugarch’

我试过升级 R,重新安装软件包都无济于事。这是我的系统设置:
sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.2 (Yosemite)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] foreach_1.4.2                 blotter_0.9.1666             
[3] FinancialInstrument_1.2.0     PerformanceAnalytics_1.4.3541
[5] quantmod_0.4-5                TTR_0.23-0                   
[7] xts_0.9-7                     zoo_1.7-12                   

loaded via a namespace (and not attached):
 [1] codetools_0.2-14   lattice_0.20-33    mvtnorm_1.0-3      truncnorm_1.0-7   
 [5] grid_3.2.1         KernSmooth_2.23-15 misc3d_0.8-4       spd_2.0-1         
 [9] iterators_1.0.7    tools_3.2.1        numDeriv_2014.2-1  Rsolnp_1.15  

任何帮助,将不胜感激。我也尝试从 cran 页面下载它,但这给出了同样的错误。就其值(value)而言,rugarch 将在我运行的 Windows 计算机上安装和加载 3.2.0 64 位计算机。

我试图从 https://cran.r-project.org/src/contrib/Archive/rugarch/ 安装旧版本的 rugarch但它甚至不会安装。我试过 1.3-3, 1.3-1, and 1.2-9 .这是我得到的错误:
gfortran-4.8: warning: couldn’t understand kern.osversion ‘14.1.0
installing to /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rugarch/libs
** R
** data
** inst
** preparing package for lazy loading
Error : .onLoad failed in loadNamespace() for 'rgl', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so
  Reason: image not found
ERROR: lazy loading failed for package ‘rugarch’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rugarch’
Warning in install.packages :
  installation of package ‘/Downloads/rugarch_1.2-9.tar.gz’ had non-zero exit status

最佳答案

两年太晚了,但对于其他寻求解决方案的人来说。对我有用的解决方案

(正如 user3710546 在上面的评论中提到的)

就是下载安装XQuartz https://www.xquartz.org

参见 Stackoverflow 答案 herehere

关于rugarch 不会加载,但可以安装得很好(在 mac 上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31932943/

相关文章:

r - 使 .combine 函数可扩展

linux - 在 linux 离线安装 stringi 包时出现 icudt 错误

samsung-smart-tv - 三星智能电视应用程序安装

debian - 如何在 Debian 上为 C 安装 ZBar

macos - macOS 中/usr/local/lib/dtrace 目录的意义是什么?

python - 安装另一个版本的 Numpy

r - is.na() 的行为与 is.numeric() 不同——一致性在哪里?

R - 带小计的数据透视表

r - 在 ggplot 中对数据进行分组之前添加 geom_smooth()

r - 如何在列上使用 tidyeval 进行变异?