在安装4.0.2版本的blotter时遇到困难。
我运行以下代码:
require(devtools)
install_github("braverock/blotter")
install_github("braverock/quantstrat")我收到以下错误消息:
Failed to install 'blotter' from GitHub:
(converted from warning) installation of package ‘/var/folders/7f/fzwn25053j3bp0yd_7swzf540000gn/T//Rtmp5kiwSh/file14db938bb63bf/blotter_0.15.0.tar.gz’ had non-zero exit status我已经成功地安装了xts、PerformanceAnalytics和FinancialInstrument。我还安装了开发工具Clang 8.0 (尽管我认为在R4.0和更高版本中不再需要它)。
任何帮助都是非常感谢的。提前谢谢。
编辑-完整输出:
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c calcPosAvgCost.c -o calcPosAvgCost.o
calcPosAvgCost.c:31:12: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
^
calcPosAvgCost.c:31:12: note: use function 'fabs' instead
if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
^~~
fabs
calcPosAvgCost.c:31:32: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
^
calcPosAvgCost.c:31:32: note: use function 'fabs' instead
if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
^~~
fabs
2 warnings generated.
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c init.c -o init.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o blotter.so calcPosAvgCost.o init.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-blotter/00new/blotter/libs
** R
** data
*** moving datasets to lazyload DB
** demo
** byte-compile and prepare package for lazy loading
Error: (converted from warning) package ‘xts’ was built under R version 4.0.2
Execution halted
ERROR: lazy loading failed for package ‘blotter’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/blotter’
Error: Failed to install 'blotter' from GitHub:
(converted from warning) installation of package ‘/var/folders/7f/fzwn25053j3bp0yd_7swzf540000gn/T//Rtmp5kiwSh/file14db956d7f3bb/blotter_0.15.0.tar.gz’ had non-zero exit status发布于 2020-08-28 11:06:30
好了,我找到了解决这个问题的方法。
我遵循了来自@boniface316的关于quanstrat的前一个问题的公式:
通过cmd安装quantstrat对我来说效果很好。以下是步骤:
github为包创建一个文件夹,即将文件从github RPackages\
”的消息
如果你有任何其他挑战,请告诉我。
这允许我安装Blotter,但不能安装Quantstrat。在尝试了一段时间后,我最终删除了quanstrat中的Vignettes文件夹,并重复了上面的步骤。通过删除此文件夹,我可以构建和安装quantstrat。
发布于 2020-12-23 19:46:33
在手动安装了blotter之后(检查上面的步骤),运行这个命令对我来说是有效的。这适用于最新的R版本(3.6或4.0 )。
devtools::install_github("braverock/quantstrat", force = TRUE )
或者从"https://r-forge.r-project.org/R/?group_id=316“(注意:你可能会看到"Build status: Failed to build”)下载旧版本(对于R3.4或更早的版本),因此下载旧版本,你可以在页面上看到选项)
https://stackoverflow.com/questions/63626026
复制相似问题