2011-04-22 29 views
0

可能重複:
Cannot install R-forge package using install.packages讓TTR在R 2.13上工作?

有沒有人得到的latest version of TTR from R-forge R上2.13的工作?即使我嘗試從源代碼編譯,我也無法將它安裝在我的Mac或我的PC上。

/編輯:這是我得到的確切錯誤,當我嘗試從R命令行安裝時。

install.packages("TTR", repos="http://R-Forge.R-project.org") 
Warning message: 
In getDependencies(pkgs, dependencies, available, lib) : 
    package ‘TTR’ is not available (for R version 2.13.0) 
+0

你試過'install.packag es(「TTR」,repos =「http://R-Forge.R-project.org」,type =「source」)'? – 2011-04-22 03:11:31

+0

@Joshua Ulrich:是的,我也遇到了同樣的錯誤。 Dirk的答案在我的Mac上爲我工作,但我仍然無法將它安裝到我的PC上。 – Zach 2011-04-22 13:02:01

回答

2

是的,肯定的:

[email protected]:~/svn/ttr$ svn up 
At revision 107. 
[email protected]:~/svn/ttr$ R CMD INSTALL . 
* installing to library ‘/usr/local/lib/R/site-library’ 
* installing *source* package ‘TTR’ ... 
** libs 
make: Nothing to be done for `all'. 
installing to /usr/local/lib/R/site-library/TTR/libs 
** R 
** data 
** preparing package for lazy loading 
Loading required package: zoo 
** help 
*** installing help indices 
** building package indices ... 
** testing if installed package can be loaded 

* DONE (TTR) 

[email protected]:~/svn/ttr$ R -e 'library(TTR); example(EMA)' 

R version 2.13.0 (2011-04-13) 
Copyright (C) 2011 The R Foundation for Statistical Computing 
ISBN 3-900051-07-0 
Platform: x86_64-pc-linux-gnu (64-bit) 
[...] 
R> library(TTR); example(EMA) 
Loading required package: xts 
Loading required package: zoo 

EMAR> data(ttrc) 

EMAR>  ema.20 <- EMA(ttrc[,"Close"], 20) 

EMAR>  sma.20 <- SMA(ttrc[,"Close"], 20) 

EMAR> dema.20 <- DEMA(ttrc[,"Close"], 20) 

EMAR> evwma.20 <- EVWMA(ttrc[,"Close"], ttrc[,"Volume"], 20) 

EMAR> zlema.20 <- ZLEMA(ttrc[,"Close"], 20) 

EMAR> ## Example of Tim Tillson's T3 indicator 
EMAR> T3 <- function(x, n=10, v=1) DEMA(DEMA(DEMA(x,n,v),n,v),n,v) 

EMAR> t3 <- T3(ttrc[,"Close"]) 

EMAR> ## Example of short-term instability of EMA 
EMAR> ## (and other indicators mentioned above) 
EMAR> x <- rnorm(100) 

EMAR> tail(EMA(x[90:100],10), 1) 
[1] 0.192859 

EMAR> tail(EMA(x[70:100],10), 1) 
[1] 0.149217 

EMAR> tail(EMA(x[50:100],10), 1) 
[1] 0.153751 

EMAR> tail(EMA(x[30:100],10), 1) 
[1] 0.153703 

EMAR> tail(EMA(x[10:100],10), 1) 
[1] 0.153703 

EMAR> tail(EMA(x[ 1:100],10), 1) 
[1] 0.153703 
R> 
0

新聞說,現在是在CRAN。我的Mac上有0.20-2,安裝程序報告這是最新的。加載似乎成功,並沒有運行幾個例子的錯誤。

重新的R-鍛造版本20-3我得到這個:

install.packages( 「TTR」,回購= 「http://R-Forge.R-project.org」) 警告消息: 在getDependencies(PKGS,依賴關係,可用的,LIB): 包 'TTR' 不可用(對於R版本2.13.0測試版)

ř版本2.13.0β(2011-04- 04 r55296)(不是最新的)

+0

r-forge的版本是0.20-3,稍微更新一些。 – Zach 2011-04-22 02:52:22

+0

沒錯。但如果它「不可用」,是否有什麼理由不能用0.20-2做? – 2011-04-22 03:59:39

+0

它有一個我希望使用的附加指示器(DVI)。 – Zach 2011-04-22 13:00:19