在我的 Windows 机器上更新到 R 4.0.0 后,我无法安装某些软件包,例如xml2
(和 也是如此foreign
)nnet
。当我尝试安装时,我收到此错误消息:
* installing *source* package 'foreign' ...
** package 'foreign' successfully unpacked and MD5 sums checked
** using staged installation
** libs
*** arch - i386
"c:/rtools40/mingw32/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c R_systat.c -o R_systat.o
sh: c:/rtools40/mingw32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:222: R_systat.o] Error 127
ERROR: compilation failed for package 'foreign'
* removing 'C:/R-PKGS/win-library/3.6/foreign'
* restoring previous 'C:/R-PKGS/win-library/3.6/foreign'
Warning in install.packages :
installation of package ‘foreign’ had non-zero exit status
安装包的主要原因xml2
是我想使用tidyverse
包,但是当我尝试运行时,library(tidyverse)
我得到了这个消息:
Error: package or namespace load failed for ‘tidyverse’:
package ‘xml2’ was installed before R 4.0.0: please re-install it
所以我想我必须能够解决我尝试安装xml2
包时出现的问题,因为将来可能会出现其他包必须更新时。
亲切的问候,安德烈斯