2

I'm trying to install the CausalImpact package and failing due to a dependency on bsts.

I've tried to install bsts without success, and looking at the results I see what I think is a failure on a dependency for Boom:

install.packages("bsts", lib="C:/R/win-library/3.3")

Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘bsts’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘bsts’

trying URL 'https://cran.rstudio.com/src/contrib/bsts_0.6.3.tar.gz'
Content type 'application/x-gzip' length 148815 bytes (145 KB)
downloaded 145 KB

* installing *source* package 'bsts' ...
** package 'bsts' successfully unpacked and MD5 sums checked
** libs

*** arch - i386
c:/Rtools/mingw_32/bin/g++  -std=c++0x -I"C:/PROGRA~1/R/R-33~1.0/include" -DNDEBUG -I`C:/PROGRA~1/R/R-33~1.0/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DNO_BOOST_THREADS -DNO_BOOST_FILESYSTEM -DADD_ -DR_NO_REMAP -DRLANGUAGE   -I"C:/Users/Firstname Lastname/Documents/R/win-library/3.3/Boom/include" -I"C:/Users/Firstname Lastname/Documents/R/win-library/3.3/BH/include" -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -mtune=core2 -c aggregate_time_series.cc -o aggregate_time_series.o
g++.exe: error: Lastname/Documents/R/win-library/3.3/Boom/include: No such file or directory

What I assume is that g++ is getting upset because R has put the library in a subfolder of C:Users/Firstname Lastname, and it's not liking the space in my name.

I tried setting the R_LIBS_USER environment variable to C:/R/win-library/3.3 to eliminate this problem with a space in the path, but with no success - even after a full restart of the computer, the error repeats - it's still going to the C:/Users/Firstname Lastname/Documents/R/win-library/3.3 directory.

I'm using RStudio 0.99.896 with R 3.3.0 on Windows 10, if that makes any difference

lmo
  • 37,904
  • 9
  • 56
  • 69
JamesF
  • 449
  • 1
  • 3
  • 15
  • Why don't you install boom, bsts, ... from CRAN _as binaries_ ? Also, setting `R_LIBS_USER` should work if you set it in the right place... – Dirk Eddelbuettel May 10 '16 at 17:13
  • Hi Dirk, I don't know how to do that - I thought the only way to install was via install.packages() – JamesF May 10 '16 at 17:15
  • I see now at [the bsts CRAN page](https://cloud.r-project.org/web/packages/bsts/index.html) that it does not come as a binary. That usually means it is not buildable on Windows so you have other issues altogether. – Dirk Eddelbuettel May 10 '16 at 17:17
  • 1
    I get the same error with a system-wide install, except that it's the "Files" in "Program Files" that trips it up. This supports your idea that it is tripped up by the space, but I haven't figured out a work around yet. – potterzot May 18 '16 at 18:13

1 Answers1

0

As suggested in this related question if you don't necessarily need the latest version of bsts you can still install version 0.6.2 on Windows, and that will let you install CausalImpact:

install.packages("https://cran.r-project.org/bin/windows/contrib/3.2/bsts_0.6.2.zip", 
                  repos = NULL, type = "local")
library(devtools)
devtools::install_github("google/CausalImpact")

works on Win 10, R 3.3.0

Community
  • 1
  • 1
sparrow
  • 1,075
  • 1
  • 10
  • 17