首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装R 4.0.2的blotter或quantstrat,尽管使用了GitHub存储库

无法安装R 4.0.2的blotter或quantstrat,尽管使用了GitHub存储库
EN

Stack Overflow用户
提问于 2020-08-28 08:59:07
回答 2查看 292关注 0票数 0

在安装4.0.2版本的blotter时遇到困难。

我运行以下代码:

代码语言:javascript
复制
require(devtools)
install_github("braverock/blotter") 
install_github("braverock/quantstrat")

我收到以下错误消息:

代码语言:javascript
复制
  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和更高版本中不再需要它)。

任何帮助都是非常感谢的。提前谢谢。

编辑-完整输出:

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

发布于 2020-08-28 11:06:30

好了,我找到了解决这个问题的方法。

我遵循了来自@boniface316的关于quanstrat的前一个问题的公式:

通过cmd安装quantstrat对我来说效果很好。以下是步骤:

github为包创建一个文件夹,即将文件从github RPackages\

  • Download到特定的文件夹,然后将文件提取到
  1. 的库名称中。即命令行上的RPackages\quantstrat\
  2. Go并转到RPackages
  3. Type“R CMD build quantstrat如果成功,您将得到类似"building 'package_name_version_number.tar.gz'"
  4. Now type: r CMD RPackages\quantstrat\
  5. Go package_name_version_number.tar.gz

”的消息

如果你有任何其他挑战,请告诉我。

这允许我安装Blotter,但不能安装Quantstrat。在尝试了一段时间后,我最终删除了quanstrat中的Vignettes文件夹,并重复了上面的步骤。通过删除此文件夹,我可以构建和安装quantstrat。

票数 1
EN

Stack Overflow用户

发布于 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或更早的版本),因此下载旧版本,你可以在页面上看到选项)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63626026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档