2

我正在尝试在 Mac 上安装 quantstrat 包,但是当我尝试

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

我明白了

package 'quantstrat' is available as a source package but not as a binary

Warning in install.packages :
  package 'quantstrat' is not available (as a binary package for R version 3.1.3)

当我从这里下载 tar.gz 文件 并尝试从 R 安装它时:

install.packages("path/quantstrat",repos = NULL, type="source")

我明白了

Warning in install.packages :
  installation of package 'path/quantstrat' had non-zero exit status

当我从终端尝试时

CMD INSTALL quantstrat_0.9.1669.tar.gz

我明白了

ERROR: dependencies ‘xts’, ‘TTR’, ‘blotter’, ‘FinancialInstrument’ are not available for package ‘quantstrat’
4

1 回答 1

2

我怀疑 tar.gz 文件已损坏,您应该尝试使用 zip 文件

所以当我尝试

install.packages("C:/Program Files/Microsoft/MRO/R3.3.0/library/blotter_0.9.1741.zip",
                                   repos = NULL, type="source")

install.packages("C:/Program Files/Microsoft/MRO/R-3.3.0/library/quantstrat_0.9.1739.zip",
                                    repos = NULL, type="source")

那么它的工作原理!

于 2016-08-30T01:18:36.210 回答