【发布时间】:2015-03-30 01:18:46
【问题描述】:
我正在尝试在 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)
当我从here 下载 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’
【问题讨论】:
-
您是否安装了
xcode?您将需要它在 Mac 上从源代码构建。此外,您可能需要使用install.packages(..., dependencies = TRUE)`。 -
然后用
dependencies = TRUE看看有没有报错。 -
它仍然返回非零退出状态。我应该应用 .tar.gz 文件还是从 tar.gz 文件解压缩的文件夹?
-
这并不聪明,但我通常只是通过并单独安装它想要的任何软件包,一旦它们全部安装完毕,就回去安装我想要的那个。你应该指向 *.tar.gz,R 会自动解压。
-
install.packages("path/quantstrat",repos = NULL, type="source")应该是install.packages("path/quantstrat_0.9.1669.tar.gz",repos = NULL, type="source")但也许这就是你要问的。
标签: r quantstrat