简体   繁体   English

R:安装 Quantstrat 错误

[英]R: Installing Quantstrat Error

I'm trying to install quantstrat, however I always get following errors trying this:我正在尝试安装 quantstrat,但是尝试此操作时我总是遇到以下错误:

> install.packages("quantstrat",repos="http://R-Forge.R-project.org")
Warning in install.packages :
  package ‘quantstrat’ is not available (for R version 3.0.1)
Installing package into ‘C:/Users/mp/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://R-Forge.R-project.org/bin/windows/contrib/3.0/quantstrat_0.7.8.zip'
Content type 'application/zip' length 1047389 bytes (1022 Kb)
opened URL
downloaded 1022 Kb

package ‘quantstrat’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\TEMP\Rtmp8uoKKX\downloaded_packages
> require(quantstrat)
Lade nötiges Paket: quantstrat
Lade nötiges Paket: foreach
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  es gibt kein Paket namens ‘iterators’
Failed with error:  ‘Paket ‘foreach’ konnte nicht geladen werden’

Sorry the error messages are German.抱歉,错误消息是德语。 The first error is: "There is no packages called 'iterators'" The second error is: "Package 'foreach' couldn't be loaded"第一个错误是:“没有名为‘迭代器’的包” 第二个错误是:“无法加载包‘foreach’”

I ran into to the same problem in order to get the install to run i had to install the quantmod package first because the rest of the packages require it pre-installed.我遇到了同样的问题,为了让安装运行,我必须先安装 quantmod 包,因为其余的包需要预先安装。

So first solve this dependency:所以首先解决这个依赖:

install.packages("quantmod")

then the rest of the packages然后剩下的包

install.packages("FinancialInstrument", repos="http://R-Forge.R-project.org")
install.packages("blotter", repos="http://R-Forge.R-project.org")
install.packages("quantstrat", repos="http://R-Forge.R-project.org")

Try installing from source, CRAN is not up to date and the latest fixes are only available by installing from source.尝试从源代码安装,CRAN 不是最新的,最新的修复程序只能通过从源代码安装来获得。 I have R-3.2.1 x64, installed fine form source.我有 R-3.2.1 x64,安装了精格式源。

Use the following in this order from your R console or RStudio:在 R 控制台或 RStudio 中按此顺序使用以下命令:

install.packages("FinancialInstrument", repos="http://R-Forge.R-project.org")
install.packages("blotter", repos="http://R-Forge.R-project.org")
install.packages("quantstrat", repos="http://R-Forge.R-project.org")

Hope this helps.希望这可以帮助。

Very late here, but perhaps relevant to note that "quantstrat" is not on CRAN, and several years ago moved to GitHub.很晚了,但可能需要注意的是,“quantstrat”不在 CRAN 上,几年前转移到 GitHub。 The README on the repo ( https://github.com/braverock/quantstrat ) has more information for installing quantstrat.存储库 ( https://github.com/braverock/quantstrat ) 上的 README 提供了有关安装 quantstrat 的更多信息。

install.packages("devtools") # if not installed
install.packages("FinancialInstrument") #if not installed
install.packages("PerformanceAnalytics") #if not installed

# next install blotter from GitHub
devtools::install_github("braverock/blotter")
# next install quantstrat from GitHub
devtools::install_github("braverock/quantstrat")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM