无法library包,请各位高手给看看什么原因

2024-11-07 01:44:30
推荐回答(2个)
回答(1):

library(rugarch) # load package
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
不存在叫‘rgl’这个名字的程辑包
Error: ‘rugarch’程辑包或名字空间载入失败,
> install.packages("rugarch")
Installing package into ‘C:/Users/think/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependency ‘RcppArmadillo’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/RcppArmadillo_0.6.500.4.0.zip'
Content type 'application/zip' length 1676766 bytes (1.6 MB)
downloaded 1.6 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/rugarch_1.3-6.zip'
Content type 'application/zip' length 3421947 bytes (3.3 MB)
downloaded 3.3 MB
package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
package ‘rugarch’ successfully unpacked and MD5 sums checked
Warning in install.packages :
unable to move temporary installation ‘C:\Users\think\Documents\R\win-library\3.2\file2780668569f3\rugarch’ to ‘C:\Users\think\Documents\R\win-library\3.2\rugarch’
The downloaded binary packages are in
C:\Users\think\AppData\Local\Temp\RtmpwF4j1C\downloaded_packages
> library(rugarch) # load package
Error in library(rugarch) : 不存在叫‘rugarch’这个名字的程辑包

回答(2):

找到C:\Users\think\AppData\Local\Temp\RtmpwF4j1C\downloaded_packages下rugarch_1.3-6.zip, 解压文件,把解压后文件夹rugarch_1.3-6里面rugarch文件夹复制到C:/Users/think/Documents/R/win-library/下面即可