如何解决尽管使用了GitHub Repository
在为4.0.2。安装吸墨纸时遇到困难。
我运行以下代码:
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(尽管我相信R 4.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
解决方法
好的,我找到了解决此问题的方法。
我遵循了先前问题中有关@ boniface316中的quanstrat的公式:
通过cmd安装Quantstrat对我来说效果很好。步骤如下:
- 为软件包创建文件夹,即RPackages \
- 将文件从github下载到该特定文件夹,然后将文件提取到库名称。即RPackages \ quantstrat \
- 在命令行上转到RPackages
- 类型” R CMD构建quantstrat 如果成功,您将收到类似“ build'package_name_version_number.tar.gz'”的消息
- 现在输入:R CMD INSTALL package_name_version_number.tar.gz
让我知道您是否还有其他挑战。
这使我可以安装Blotter,但不能安装Quantstrat。在玩了一段时间之后,我最终删除了quanstrat中的Vignettes文件夹,并重复了上述步骤。通过删除此文件夹,我能够构建和安装quantstrat。
,手动安装吸墨纸后(检查上面帖子中给出的步骤),运行此命令对我有用。这是针对最新的 R 版本(3.6 或 4.0)。
devtools::install_github("braverock/quantstrat",force = TRUE )
或从“https://r-forge.r-project.org/R/?group_id=316”下载较旧的(对于 R 3.4 或更早版本)版本的 zip (注意:您可能会看到“构建状态:无法构建”,因此下载旧版本,您可以在页面上看到该选项)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。