如何在Windows 10的R中安装stringi软件包?

时间:2018-08-21 16:35:32

标签: r rstudio stringi

我刚刚安装了R和RStudio,所以它是最新版本。 我正在尝试安装Rattle,但出现stringi错误,因此我尝试安装stringi,但出现以下错误:

Installing package into ‘C:/Users/.../Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
** libs

*** arch - i386
c:/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0         -O2 -Wall  -mtune=generic -c stri_pad.cpp -o stri_pad.o
/bin/sh: c:/Rtools/mingw_32/bin/g++: No such file or directory
make: *** [C:/PROGRA~1/R/R-35~1.1/etc/i386/Makeconf:215: stri_pad.o] Error 127
ERROR: compilation failed for package 'stringi'
* removing 'C:/Users/maryamr/Documents/R/win-library/3.5/stringi'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘C:/Users/maryamr/Downloads/stringi_1.2.4.tar.gz’ had non-zero exit status

1 个答案:

答案 0 :(得分:1)

如果要从Windows上的源代码构建R软件包,则需要Rtools。在这种情况下,这可能很困难,因为stringi当前在Windows上失败。您可以通过

安装最新的可用Windows二进制文件
install.packages("stringi", type = "win.binary")