安装tseries包失败

时间:2011-08-20 13:24:20

标签: r

我正在尝试在R上安装tseries包。我得到了这个输出:

> install.packages('tseries') 
Warning in install.packages("tseries") : 
  argument 'lib' is missing: using '/usr/local/lib/R/site-library' 
--- Please select a CRAN mirror for use in this session --- 
CRAN mirror 

1: Argentina (La Plata)      2: Argentina (Mendoza)    
3: Australia (Canberra)      4: Australia (Melbourne)  
5: Austria                  6: Belgium                
7: Brazil (PR)              8: Brazil (RJ)            
9: Brazil (SP 1)            10: Brazil (SP 2)          
11: Canada (BC)              12: Canada (NS)            
13: Canada (ON)              14: Canada (QC 1)          
15: Canada (QC 2)            16: Chile                  
17: China (Beijing 1)        18: China (Beijing 2)      
19: China (Hefei)            20: China (Hong Kong)      
21: China (Xiamen)          22: Colombia (Bogota)      
23: Colombia (Cali)          24: Denmark                
25: France (Toulouse)        26: France (Lyon 1)        
27: France (Lyon 2)          28: Germany (Berlin)      
29: Germany (Goettingen)    30: Germany (Muenchen)    
31: Germany (Wiesbaden)      32: Greece                
33: Indonesia                34: Iran                  
35: Ireland                  36: Italy (Milano)        
37: Italy (Padua)            38: Italy (Palermo)        
39: Japan (Hyogo)            40: Japan (Tsukuba)        
41: Korea                    42: Mexico (Mexico City)  
43: Mexico (Texcoco)        44: Netherlands (Amsterdam) 
45: Netherlands (Utrecht)    46: New Zealand            
47: Norway                  48: Philippines            
49: Poland (Gdansk)          50: Poland (Oswiecim)      
51: Poland (Wroclaw)        52: Russia                
53: Singapore                54: Slovakia 1            
55: Slovakia 2              56: South Africa          
5    7: Spain (Madrid)          58: Sweden                
59: Switzerland              60: Taiwan (Taichung)      
61: Taiwan (Taipei 1)        62: Taiwan (Taipei 2)      
63: Thailand                64: UK (Bristol)          
65: UK (London)              66: UK (St Andrews)        
67: USA (AZ)                68: USA (CA 1)            
69: USA (CA 2)              70: USA (IA)              
71: USA (MA)                72: USA (MI)              
73: USA (MO)                74: USA (OH)              
75: USA (OR)                76: USA (PA 1)            
77: USA (PA 2)              78: USA (TX 1)            
79: USA (TX 2)              80: USA (WA 1)            
81: USA (WA 2)              

Selection: 80 
Warning: dependency ‘quadprog’ is not available 
trying URL 'http://cran.fhcrc.org/src/contrib/tseries_0.10-26.tar.gz' 
Content type 'application/x-gzip' length 163770 bytes (159 Kb) 
opened URL 
================================================== 
downloaded 159 Kb 

ERROR: dependencies ‘quadprog’ are not available for package ‘tseries’ 
* removing ‘/usr/local/lib/R/site-library/tseries’ 

The downloaded packages are in 
    ‘/tmp/Rtmp4BUi9T/downloaded_packages’ 
Warning message: 
In install.packages("tseries") : 
  installation of package 'tseries' had non-zero exit status 

如何安装此软件包?

2 个答案:

答案 0 :(得分:6)

tseries 取决于 quadprog 包。您没有安装该软件包,并且在您使用的R版本(未说明)上使用的CRAN镜像上没有该软件包。因此无法安装 tseries

您需要为您的R版本安装 quadprog 。如果您是当前版本之后的几个版本,则可能无法使用它。 quadprog取决于R> = 2.12.0

[顺便说一下,这些东西是R ,而不是。]

答案 1 :(得分:0)

我遇到了同样的问题,然后按照以下方式解决了问题。

在Ubuntu中使用终端,我输入以下命令:

wget http://cran.r-project.org/src/contrib/quadprog_1.5-4.tar.gz
sudo R CMD INSTALL quadprog_1.5-4.tar.gz
wget http://cran.r-project.org/src/contrib/tseries_0.10-30.tar.gz
sudo R CMD INSTALL tseries_0.10-30.tar.gz

完成此操作后,我就可以启动R会话,加载tseries包,并成功使用其功能。

您可能希望安装不同版本的quadprog和tseries软件包。如果是这种情况,请相应地更改上述网址链接。