簡體   English   中英

R:安裝軟件包時出現問題(與目錄名稱中的空間有關嗎?)

[英]R: Problems installing package (related to space in directory name?)

我正在嘗試安裝CausalImpact軟件包,但由於對bsts的依賴而失敗。

我嘗試安裝bsts失敗,然后查看結果,我發現我認為對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

我假設g ++變得不高興,因為R將庫放在C:Users / Firstname Lastname的子文件夾中,並且不喜歡我的名字中的空格。

我嘗試將R_LIBS_USER環境變量設置為C:/R/win-library/3.3以消除路徑中帶有空格的此問題,但沒有成功-即使在計算機完全重新啟動后,該錯誤仍在重復-它仍在繼續到C:/ Users / Firstname Lastname / Documents / R / win-library / 3.3目錄。

我在Windows 10上使用R Studio 0.99.896和R 3.3.0,如果有任何區別

如這個相關問題中的建議,如果您不一定需要最新版本的bsts您仍然可以在Windows上安裝版本0.6.2,這將使您安裝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")

適用於Win 10,R 3.3.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM