简体   繁体   中英

Installing packages in R gives the following errors

When trying to install some packages such Rcmdr or factoextra while on R in terminal (after upgrade to R 4.0.0 on Archlabs) the following errors shows up:

* installing *source* package ‘SparseM’ ...
** package ‘SparseM’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2  -c bckslv.f -o bckslv.o
/usr/local/bin/gfortran: /usr/local/bin/gfortran: cannot execute binary file
make: *** [/usr/lib64/R/etc/Makeconf:190: bckslv.o] Error 126
ERROR: compilation failed for package ‘SparseM’
* removing ‘/usr/lib/R/library/SparseM’

and this one:

* installing *source* package ‘readr’ ...
** package ‘readr’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/include/R/" -DNDEBUG  -I'/usr/lib/R/library/Rcpp/include' -I'/usr/lib/R/library/BH/include' -D_FORTIFY_SOURCE=2  -I. -Ircon -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt  -c Collector.cpp -o Collector.o
In file included from /usr/lib/R/library/Rcpp/include/Rcpp.h:77,
                 from Collector.cpp:1:
/usr/lib/R/library/Rcpp/include/Rcpp/Rmath.h: In function ‘double R::pythag(double, double)’:
/usr/lib/R/library/Rcpp/include/Rcpp/Rmath.h:222:57: error: ‘::Rf_pythag’ has not been declared; did you mean ‘pythag’?
  222 |     inline double pythag(double a, double b) { return ::Rf_pythag(a, b); }
      |                                                         ^~~~~~~~~
      |                                                         pythag
make: *** [/usr/lib64/R/etc/Makeconf:176: Collector.o] Error 1

then followed by a bunch of

ERROR: dependencies ‘dendextend’, ‘FactoMineR’, ‘ggpubr’, ‘ggrepel’, ‘tidyr’ are not available for package ‘factoextra’
* removing ‘/usr/lib/R/library/factoextra’

following each dependencies produces the same errors with different new dependencies.

PS: I'm a normie so please bear with me.

I had a similar error while installing 'ape'. For me it worked to reinstall the current version of the 'Rcpp' package:

install.packages('Rcpp')

Hope it works for you too !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM