1

我正在使用 Windows 10 和最新的 R、Rstudio 和 Rtools。我的 R 可以从 CRAN 安装软件包,但不能从 Github 安装软件包,并收到非常奇怪的消息。我在 Stackoverflow、github issue 和 Google 搜索中查看了类似的问题,但没有找到答案。我尝试在不同的目录和不同版本的 R 和 Rstudio 中重新安装 R、Rstudio 和 Rtools。没有什么帮助。如果有人可以给我一些帮助,我将不胜感激。这是我尝试安装时收到的错误消息xaringan

> install_github('yihui/xaringan')
Downloading GitHub repo yihui/xaringan@master
from URL https://api.github.com/repos/yihui/xaringan/zipball/master
Installing xaringan
"C:/R-stabl/bin/x64/R" --no-site-file  \
  --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL "C:/Users/Yue  \
  Hu_local/AppData/Local/Temp/RtmpyGCl8D/devtools1c10a142590/yihui-xaringan-0453431"  \
  --library="D:/userLib" --install-tests 

* installing *source* package 'xaringan' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
  converting help for package 'xaringan'
    finding HTML links ... done
    inf_mr                                  html  
    finding level-2 HTML links ... done

    moon_reader                             html  
    summon_remark                           html  
** building package indices
** installing vignettes
** testing if installed package can be loaded
ARGUMENT 'Hu_local\AppData\Local\Temp\RtmpmA717i\Rin254c7d787958' __ignored__

Error: object 'ÿþ' not found
Execution halted
ERROR: loading failed
* removing 'D:/userLib/xaringan'
* restoring previous 'D:/userLib/xaringan'
In R CMD INSTALL
Installation failed: Command failed (1)

我的 Rtools 安装良好:

> devtools::has_devel()
"C:/R-stabl/bin/x64/R" --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD SHLIB foo.c 

c:/Rtools/mingw_64/bin/gcc  -I"C:/R-stabl/include" -DNDEBUG          -O2 -Wall  -std=gnu99 -mtune=generic -c foo.c -o foo.o
c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o foo.dll tmp.def foo.o -LC:/R-stabl/bin/x64 -lR
[1] TRUE

这是我的系统信息:

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

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

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

loaded via a namespace (and not attached):
[1] compiler_3.4.3  withr_2.1.1     memoise_1.1.0   digest_0.6.14  
[5] devtools_1.13.4
4

1 回答 1

0

这个问题的解决方案在这里找到:原来是临时方向的问题,这可能是 Windows 独有的。在我将 temp 重定向到一个没有空格的新方向后(在 .Renviron 中),问题就消失了。

于 2018-01-18T22:42:19.457 回答