如何在安装包时修复R中的此错误?

时间:2016-03-17 09:44:43

标签: r install packages

这就是我所做的:

install.packages("TSA",lib="D:/R/packages")    
library(TSA,lib.loc="D:/R/packages")    
install.packages("leaps",lib="D:/R/packages")  

仍然收到错误:

library(TSA,lib.loc="D:/R/packages") 
#Error: package ‘leaps’ required by ‘TSA’ could not be found

1 个答案:

答案 0 :(得分:0)

CRAN有一个包TSA。如果你想安装它:

install.packages("TSA")

如果您已有.tar.gz个文件。我建议使用Hadley Wickham的devtoolspackage。它允许从给定目录加载包:

library(devtools)

# load package w/o installing
load_all('D:/R/packages')

# or invoke 'R CMD INSTALL'
install('D:/R/packages')