1

I am experiencing a hard time in installing the blotter and quantstrat packages from Github. Most helps I can find online are quite outdated issued back then when they are hosted on sourceforge. I try to use the install_github() function and it returns error below. (In fact there is similar error when I try R-Forge) Can anyone provide a clue on what is happening here?

install_github("braverock/blotter")
Downloading GitHub repo braverock/blotter@master
from URL https://api.github.com/repos/braverock/blotter/zipball/master
Installing blotter
"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  "C:/Users/User/AppData/Local/Temp/Rtmp8mMwyT/devtools416cfd229e7/braverock-blotter-bdefb02"  \
  --library="C:/Program Files/R/R-3.3.3/library" --install-tests 

* installing *source* package 'blotter' ...
** libs

*** arch - i386
c:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG     -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c calcPosAvgCost.c -o calcPosAvgCost.o
make: sh.exe: Command not found
make: *** [calcPosAvgCost.o] Error 127
Warning: running command 'make -f "C:/PROGRA~1/R/R-33~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.3/share/make/winshlib.mk" SHLIB="blotter.dll" OBJECTS="calcPosAvgCost.o"' had status 2
ERROR: compilation failed for package 'blotter'
* removing 'C:/Program Files/R/R-3.3.3/library/blotter'
Error: Command failed (1)

Rtools installed and included in the PATH variable:

  • C:\RBuildTools\3.3\bin
  • C:\RBuildTools\3.3\gcc-4.6.3\bin

Session info:

R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.12.0

loaded via a namespace (and not attached):
[1] httr_1.1.0    R6_2.1.2      tools_3.3.3   withr_1.0.2   curl_2.3     
[6] memoise_1.0.0 git2r_0.14.0  digest_0.6.11
3
  • 1
    Can you tell us where sh.exe is located? It also looks like it searches for c:\Rtools while your PATH variable is c:\RbuildTools . Is this correct?
    – ricoderks
    Apr 25, 2017 at 10:23
  • It is in C:\RBuildTools\3.3\bin. I actually just installed Rtools 3.3 and uninstalled Rtools 3.2 (as a part of upgrading my R version to 3.3.3), and some old Rtools files still exist in c:\RbuildTools. But I have changed the PATH variable to refer to the new directory (and removed the old ones). Will I still need to change anything else?
    – bluk
    Apr 25, 2017 at 15:05
  • Update: It worked after I removed the old Rtools directory. Many thanks for @ricoderks for pointing me to the right way. For anyone who might reach here it also requires the installation of xts version 0.10.0 by install_github("joshuaulrich/xts") as of now.
    – bluk
    Apr 26, 2017 at 1:59

2 Answers 2

Reset to default

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

14

Try this:

install.packages("devtools")
require(devtools)
install_github("braverock/FinancialInstrument")
install_github("joshuaulrich/xts")
install_github("braverock/blotter")
install_github("braverock/quantstrat")
install_github("braverock/PerformanceAnalytics")
0
2

I had the same problem, even if did not worked with the method above. It gave me the error:

"C:/Users/dstoc/AppData/Local/Temp/RtmpiuN8Ii/file53c7224677c/blotter_0.14.7.tar.gz’ had non-zero exit status". 

So for future questions: I've installed blotter and quantstrat manually from Rstudio.

  1. First of all, I've installed these tools as recommended.

install.packages("devtools")
require(devtools)
install_github("braverock/FinancialInstrument")
install_github("joshuaulrich/xts")
  1. Then, I went on the console of Rstudio > packages > install. In the option 'install from' I've selected 'package archive file'.

Click for example This allows you to browse your file.

  1. I've searched for blotter first and then quantstrat and selected the file tar.gz

  2. It worked. Don't know if the best way but it worked.

1
  • I've installed PerformanceAnalytics this way, but picking the default location (C:/Users...) didn't work ( Failed to lock directory..), however I could install it in C:/R-3.6.3/library. Then load it while indicating this specific library (usually the second one in .libPaths) with library('PerformanceAnalytics', lib.loc=.libPaths()[2])
    – alp
    May 23, 2020 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.