安装quantstrat for 3.4.2版的问题

时间:2017-11-19 17:41:39

标签: r install.packages quantstrat

我正在尝试在R中安装quantstrat包。我已经安装了quantstrat所需的其他包,下面是我的会话信息。

function date2day_mdy($date2fix) {
    $date_fixed = date("D m-d-Y",$date2fix);
    return $date_fixed;
}
$d=strtotime("10:30pm April 15 2014"); // works - yes
//$d=strtotime)"2013-01-10 00:00:00"); // works - no
$returned_date = date2day_mdy($d);
echo $returned_date."<br>";

当我运行安装包时,这就是我得到的:

sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252    LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C                      
[5] LC_TIME=Portuguese_Brazil.1252    

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

other attached packages:
 [1] blotter_0.12.4             PerformanceAnalytics_1.5.1 FinancialInstrument_1.2.0  foreach_1.4.3              quantmod_0.4-11           
 [6] TTR_0.23-2                 devtools_1.13.4            xts_0.10-0                 zoo_1.8-0                  lubridate_1.7.1           

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13     rstudioapi_0.7   knitr_1.17       magrittr_1.5     lattice_0.20-35  R6_2.2.2         quadprog_1.5-5   stringr_1.2.0   
 [9] httr_1.3.1       tools_3.4.2      grid_3.4.2       git2r_0.19.0     withr_2.1.0      iterators_1.0.8  yaml_2.1.14      digest_0.6.12   
[17] codetools_0.2-15 curl_3.0         memoise_1.1.0    stringi_1.1.5    compiler_3.4.2   boot_1.3-20  

我也尝试下载以前的版本并安装它,但没有成功,我从以下链接获得它:

http://download.r-forge.r-project.org/bin/windows/contrib/3.2/quantstrat_0.9.1739.zip

install.packages("quantstrat", repos="https://github.com/braverock/quantstrat.git")
Installing package into ‘C:/Users/augus/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository https://github.com/braverock/quantstrat.git/src/contrib:
  cannot open URL 'https://github.com/braverock/quantstrat.git/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘quantstrat’ is not available (for R version 3.4.2)
Warning in install.packages :
  unable to access index for repository https://github.com/braverock/quantstrat.git/bin/windows/contrib/3.4:
  cannot open URL 'https://github.com/braverock/quantstrat.git/bin/windows/contrib/3.4/PACKAGES'

有人知道我做错了吗?

由于

奥古斯托

1 个答案:

答案 0 :(得分:1)

如上述评论中所述,为了完整起见,这里是一个答案。

安装最新版本的quantstrat最直接的方法是通过带有devtools的github(R-forge上的quantstrat版本现已过期):

library(devtools) 
install_github("braverock/quantstrat")