R packages failing to install - r

I am trying to install the package pathview in R version 4.0.0. I first installed biocmanager without issue then used this command as directed:
BiocManager::install("pathview")
However it failed to install with the following error:
BiocManager::install("pathview")
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://cran.csiro.au
Bioconductor version 3.12 (BiocManager 1.30.16), R 4.0.0 (2020-04-24)
Installing package(s) 'pathview'
also installing the dependencies ‘RSQLite’, ‘AnnotationDbi’, ‘org.Hs.eg.db’
trying URL 'https://cran.csiro.au/src/contrib/RSQLite_2.2.7.tar.gz'
Content type 'application/x-gzip' length 3616162 bytes (3.4 MB)
==================================================
downloaded 3.4 MB
trying URL 'https://bioconductor.org/packages/3.12/bioc/src/contrib/AnnotationDbi_1.52.0.tar.gz'
Content type 'application/x-gzip' length 4338642 bytes (4.1 MB)
==================================================
downloaded 4.1 MB
trying URL 'https://bioconductor.org/packages/3.12/data/annotation/src/contrib/org.Hs.eg.db_3.12.0.tar.gz'
Content type 'application/x-gzip' length 83225518 bytes (79.4 MB)
==================================================
downloaded 79.4 MB
trying URL 'https://bioconductor.org/packages/3.12/bioc/src/contrib/pathview_1.30.1.tar.gz'
Content type 'application/x-gzip' length 2192604 bytes (2.1 MB)
==================================================
downloaded 2.1 MB
* installing *source* package ‘RSQLite’ ...
** package ‘RSQLite’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
icpc -std=gnu++11 -I"/apps/R/4.0.0/lib64/R/include" -DNDEBUG -I. -Ivendor -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I'/home/590/mr8122/R/x86_64-pc-linux-gnu-library/4.0/plogr/include' -I'/home/590/mr8122/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include' -I/usr/local/include -fpic -g -O2 -c DbColumn.cpp -o DbColumn.o
In file included from vendor/boost/container/stable_vector.hpp(68),
from RSQLite.h(14),
from pch.h(1),
from DbColumn.cpp(1):
vendor/boost/container/vector.hpp(2705): warning #2196: routine is both "inline" and "noinline"
BOOST_CONTAINER_NOINLINE iterator priv_insert_forward_range_no_capacity
^
In file included from vendor/boost/container/stable_vector.hpp(68),
from RSQLite.h(14),
from pch.h(1),
from DbColumn.cpp(1):
vendor/boost/container/vector.hpp(2722): warning #2196: routine is both "inline" and "noinline"
BOOST_CONTAINER_NOINLINE iterator priv_insert_forward_range_no_capacity
^
In file included from vendor/boost/preprocessor/control/while.hpp(323),
from vendor/boost/preprocessor/arithmetic/add.hpp(60),
from vendor/boost/mpl/aux_/preprocessor/def_params_tail.hpp(66),
from vendor/boost/mpl/aux_/na_spec.hpp(28),
from vendor/boost/mpl/if.hpp(19),
from vendor/boost/ptr_container/detail/default_deleter.hpp(15),
from vendor/boost/ptr_container/detail/static_move_ptr.hpp(23),
from vendor/boost/ptr_container/detail/reversible_ptr_container.hpp(22),
from vendor/boost/ptr_container/ptr_sequence_adapter.hpp(20),
from vendor/boost/ptr_container/ptr_vector.hpp(20),
from RSQLite.h(15),
from pch.h(1),
from DbColumn.cpp(1):
vendor/boost/preprocessor/list/fold_left.hpp(341): catastrophic error: cannot open source file "boost/preprocessor/list/detail/edg/fold_left.hpp"
# include <boost/preprocessor/list/detail/edg/fold_left.hpp>
^
compilation aborted for DbColumn.cpp (code 4)
make: *** [/apps/R/4.0.0/lib64/R/etc/Makeconf:176: DbColumn.o] Error 4
ERROR: compilation failed for package ‘RSQLite’
* removing ‘/home/590/mr8122/R/x86_64-pc-linux-gnu-library/4.0/RSQLite’
ERROR: dependency ‘RSQLite’ is not available for package ‘AnnotationDbi’
* removing ‘/home/590/mr8122/R/x86_64-pc-linux-gnu-library/4.0/AnnotationDbi’
ERROR: dependency ‘AnnotationDbi’ is not available for package ‘org.Hs.eg.db’
* removing ‘/home/590/mr8122/R/x86_64-pc-linux-gnu-library/4.0/org.Hs.eg.db’
ERROR: dependencies ‘AnnotationDbi’, ‘org.Hs.eg.db’ are not available for package ‘pathview’
* removing ‘/home/590/mr8122/R/x86_64-pc-linux-gnu-library/4.0/pathview’
The downloaded source packages are in
‘/scratch/ki16/mr8122/tmp/RtmpYxgwWN/downloaded_packages’
Installation paths not writeable, unable to update packages
path: /apps/R/4.0.0/lib64/R/library
packages:
boot, class, cluster, codetools, foreign, KernSmooth, lattice, MASS,
Matrix, mgcv, nlme, nnet, spatial, survival
Warning messages:
1: In .inet_warning(msg) :
installation of package ‘RSQLite’ had non-zero exit status
2: In .inet_warning(msg) :
installation of package ‘AnnotationDbi’ had non-zero exit status
3: In .inet_warning(msg) :
installation of package ‘org.Hs.eg.db’ had non-zero exit status
4: In .inet_warning(msg) :
installation of package ‘pathview’ had non-zero exit status
Does anyone know why this might be failing?

RSQLite is failing to find Boost. I recommend installing Boost from source and then re-attempting the R package install.
I was originally seeing this error when installing biomaRt with BiocManager. After installing Boost, I was successfully able to install RSQLite. Depending on your system and installation, it may require further manipulation of your library paths to allow R to find your new Boost install.

Related

Error when installing brms package in R - bayesplot cannot be installed

I am trying to install the R package brms on my Ubuntu 22.04 LTS computer. My R version is 4.2.2 and I am using RStudio RStudio 2022.07.2 "Spotted Wakerobin".
rstan is installed and I have successfully verified the installation. My stan version is 2.21.0.
When I try installing brms in RStudio this is the output:
> install.packages("brms")
Installing package into ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘bayesplot’, ‘shinystan’, ‘bridgesampling’, ‘nleqslv’
trying URL 'https://cloud.r-project.org/src/contrib/bayesplot_1.10.0.tar.gz'
Content type 'application/x-gzip' length 4993447 bytes (4.8 MB)
==================================================
downloaded 4.8 MB
trying URL 'https://cloud.r-project.org/src/contrib/shinystan_2.6.0.tar.gz'
Content type 'application/x-gzip' length 2399890 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
trying URL 'https://cloud.r-project.org/src/contrib/bridgesampling_1.1-2.tar.gz'
Content type 'application/x-gzip' length 1679600 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/nleqslv_3.3.3.tar.gz'
Content type 'application/x-gzip' length 84686 bytes (82 KB)
==================================================
downloaded 82 KB
trying URL 'https://cloud.r-project.org/src/contrib/brms_2.18.0.tar.gz'
Content type 'application/x-gzip' length 4486548 bytes (4.3 MB)
==================================================
downloaded 4.3 MB
* installing *source* package ‘bayesplot’ ...
** package ‘bayesplot’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in element_line(linewidth = 0.3) :
unused argument (linewidth = 0.3)
Error: unable to load R code in package ‘bayesplot’
Execution halted
ERROR: lazy loading failed for package ‘bayesplot’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/bayesplot’
Warning in install.packages :
installation of package ‘bayesplot’ had non-zero exit status
* installing *source* package ‘bridgesampling’ ...
** package ‘bridgesampling’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (bridgesampling)
* installing *source* package ‘nleqslv’ ...
** package ‘nleqslv’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/usr/share/R/include" -DNDEBUG -I"/usr/lib/R/site-library/Rcpp/include/" -I"/usr/lib/R/site-library/RcppEigen/include/" -I"/usr/lib/R/site-library/RcppEigen/include/unsupported" -I"/usr/lib/R/site-library/BH/include" -I"/usr/lib/R/site-library/StanHeaders/include/src/" -I"/usr/lib/R/site-library/StanHeaders/include/" -I"/usr/lib/R/site-library/RcppParallel/include/" -I"/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DBOOST_NO_AUTO_PTR -include '/usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp' -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1 -fpic -g -O2 -ffile-prefix-map=/build/r-base-Faorqz/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c init.c -o init.o
In file included from /usr/lib/R/site-library/RcppEigen/include/Eigen/Core:88,
from /usr/lib/R/site-library/RcppEigen/include/Eigen/Dense:1,
from /usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
from <command-line>:
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/util/Macros.h:628:1: error: unknown type name ‘namespace’
628 | namespace Eigen {
| ^~~~~~~~~
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/util/Macros.h:628:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
628 | namespace Eigen {
| ^
In file included from /usr/lib/R/site-library/RcppEigen/include/Eigen/Dense:1,
from /usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
from <command-line>:
/usr/lib/R/site-library/RcppEigen/include/Eigen/Core:96:10: fatal error: complex: No such file or directory
96 | #include <complex>
| ^~~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:169: init.o] Error 1
ERROR: compilation failed for package ‘nleqslv’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/nleqslv’
Warning in install.packages :
installation of package ‘nleqslv’ had non-zero exit status
ERROR: dependency ‘bayesplot’ is not available for package ‘shinystan’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/shinystan’
Warning in install.packages :
installation of package ‘shinystan’ had non-zero exit status
ERROR: dependencies ‘bayesplot’, ‘shinystan’, ‘nleqslv’ are not available for package ‘brms’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/brms’
Warning in install.packages :
installation of package ‘brms’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpS56F1Q/downloaded_packages’
There seems to be a problem when installing bayesplot but I'm not sure how to solve it.
Does anyone have any suggestions?
Just in case someon encounters the same problem:
I installed devtools to be able to install bayesplot directly from github using:
install_github("stan-dev/bayesplot", dependencies = TRUE, build_vignettes = FALSE)
This only worked for me after installing all the packages that throw compilation errors in R directly and not in RStudio.
After bayesplot was installed, I was able to install brms.

Installing package "quantreg" in R fails with "had non-zero exit status"

My aim is to install the R package "quantreg". In R Studio, I therefore type
install.packages("quantreg")
R Studio then prints:
binary source needs_compilation
quantreg 5.85 5.88 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
I consequently write "Yes" and hit enter. The installation then fails with the following output:
installing the source package ‘quantreg’
trying URL 'https://cran.rstudio.com/src/contrib/quantreg_5.88.tar.gz'
Content type 'application/x-gzip' length 1016964 bytes (993 KB)
==================================================
downloaded 993 KB
* installing *source* package ‘quantreg’ ...
** package ‘quantreg’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fPIC -Wall -g -O2 -c akj.f -o akj.o
make: gfortran: No such file or directory
make: *** [akj.o] Error 1
ERROR: compilation failed for package ‘quantreg’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/quantreg’
Warning in install.packages :
installation of package ‘quantreg’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/bl/yxw71y6n3ksbktr_vmp65h1m0000gn/T/Rtmpc1SB0G/downloaded_packages’
I am on Mac OS 12.3.1 Monterey and use R version 3.6.3. I use this old version of R (instead of an up-to-date one) because it is required in combination with another program that I use. Therefore, I cannot use newer versions of R.
What could be a possible fix for my problem, so that R installs quantreg without failing?

Unable to install specific R packages

I am trying to install sf package in R, but it returns error and unable to install the package.
The warning message said
installation of package ‘sf’ had non-zero exit status.
Would you please advise me on how to install the package? I am using Windows with R version 3.6.1.
Platform: x86_64-w64-mingw32/x64 (64-bit)
Below is the all messages:
> install.packages("sf")
Installing package into ‘C:/Users/***/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘wk’, ‘s2’, ‘units’
There are binary versions available but the source versions are later:
binary source needs_compilation
wk 0.4.1 0.5.0 TRUE
s2 1.0.4 1.0.7 TRUE
units 0.7-1 0.7-2 TRUE
sf 0.9-8 1.0-4 TRUE
installing the source packages ‘wk’, ‘s2’, ‘units’, ‘sf’
trying URL 'https://cran.rstudio.com/src/contrib/wk_0.5.0.tar.gz'
Content type 'application/x-gzip' length 138686 bytes (135 KB)
downloaded 135 KB
trying URL 'https://cran.rstudio.com/src/contrib/s2_1.0.7.tar.gz'
Content type 'application/x-gzip' length 2235408 bytes (2.1 MB)
downloaded 2.1 MB
trying URL 'https://cran.rstudio.com/src/contrib/units_0.7-2.tar.gz'
Content type 'application/x-gzip' length 855840 bytes (835 KB)
downloaded 835 KB
trying URL 'https://cran.rstudio.com/src/contrib/sf_1.0-4.tar.gz'
Content type 'application/x-gzip' length 3526535 bytes (3.4 MB)
downloaded 3.4 MB
* installing *source* package 'wk' ...
** パッケージ 'wk' の解凍および MD5 サムの検証に成功しました
** using staged installation
** libs
*** arch - i386
c:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -I../inst/include/ -I"C:/Users/***/Documents/R/win-library/3.6/cpp11/include" -O3 -Wall -std=gnu99 -mtune=generic -c bbox-handler.c -o bbox-handler.o
sh: line 1: c:/Rtools/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-36~1.1/etc/i386/Makeconf:208: bbox-handler.o] Error 127
ERROR: compilation failed for package 'wk'
* removing 'C:/Users/***/Documents/R/win-library/3.6/wk'
Warning in install.packages :
installation of package ‘wk’ had non-zero exit status
* installing *source* package 'units' ...
** パッケージ 'units' の解凍および MD5 サムの検証に成功しました
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
*** arch - i386
rm -Rf units.dll RcppExports.o udunits.o
"C:/PROGRA~1/R/R-36~1.1/bin/i386/Rscript.exe" "../tools/winlibs.R"
mkdir -p ../inst
rm -Rf ../inst/share
cp -r ../windows/udunits-2.2.20/share ../inst/
c:/Rtools/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -DUDUNITS2_DIR=0 -I../windows/udunits-2.2.20/include -I"C:/Program Files/R/R-3.6.1/library/Rcpp/include" -O2 -Wall -mtune=generic -c RcppExports.cpp -o RcppExports.o
sh: line 1: c:/Rtools/mingw_32/bin/g++: No such file or directory
make: *** [C:/PROGRA~1/R/R-36~1.1/etc/i386/Makeconf:215: RcppExports.o] Error 127
ERROR: compilation failed for package 'units'
* removing 'C:/Users/***/Documents/R/win-library/3.6/units'
Warning in install.packages :
installation of package ‘units’ had non-zero exit status
ERROR: dependency 'wk' is not available for package 's2'
* removing 'C:/Users/***/Documents/R/win-library/3.6/s2'
Warning in install.packages :
installation of package ‘s2’ had non-zero exit status
ERROR: dependencies 's2', 'units' are not available for package 'sf'
* removing 'C:/Users/***/Documents/R/win-library/3.6/sf'
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\***\AppData\Local\Temp\RtmpuiUgtA\downloaded_packages’
I specified the package's url as below, but it returns error as well;
> install.packages("https://cran.r-project.org/src/contrib/sf_1.0-4.tar.gz", repos=NULL)
Installing package into ‘C:/Users/***/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.r-project.org/src/contrib/sf_1.0-4.tar.gz'
Content type 'application/x-gzip' length 3526535 bytes (3.4 MB)
downloaded 3.4 MB
ERROR: dependencies 's2', 'units' are not available for package 'sf'
* removing 'C:/Users/***/Documents/R/win-library/3.6/sf'
Warning in install.packages :
installation of package ‘C:/Users/***/AppData/Local/Temp/RtmpuiUgtA/downloaded_packages/sf_1.0-4.tar.gz’ had non-zero exit status

Installing samr in in R 3.4

I am having issues in installing the samr package in R v3.4 MacOS sierra. I get this warning message:
"Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘samr’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘samr’
trying URL 'https://cran.rstudio.com/src/contrib/samr_2.0.tar.gz'
Content type 'application/x-gzip' length 36702 bytes (35 KB)
==================================================
downloaded 35 KB
* installing *source* package ‘samr’ ...
** libs
gfortran -fPIC -g -O2 -c rankcol.f -o rankcol.o
make: gfortran: No such file or directory
make: *** [rankcol.o] Error 1
ERROR: compilation failed for package ‘samr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/samr’
Warning in install.packages :
installation of package ‘samr’ had non-zero exit status
Does anybody has an idea to overcome this?
Thanks so much, I dwonloaded gofortran for macOs sierra https://gcc.gnu.org/wiki/GFortranBinaries#MacOS and it seems to work now

r package installation issue "arules"

I am trying to install r package "arules" in linux system.I am using R version 3.2.2 (32 bit).
The error message is like this:
>install.packages("arules")
Installing package into ‘/home/mi/R/i686-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘lattice’, ‘Matrix’
trying URL 'https://dirichlet.mat.puc.cl/src/contrib/lattice_0.20-33.tar.gz'
Content type 'application/x-gzip' length 353706 bytes (345 KB)
==================================================
downloaded 345 KB
trying URL 'https://dirichlet.mat.puc.cl/src/contrib/Matrix_1.2-3.tar.gz'
Content type 'application/x-gzip' length 1784878 bytes (1.7 MB)
==========d========================================
downloaded 1.7 MB
trying URL 'https://dirichlet.mat.puc.cl/src/contrib/arules_1.3-1.tar.gz'
Content type 'application/x-gzip' length 1357643 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
* installing *source* package ‘lattice’ ...
** package ‘lattice’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
make: *** [init.o] Error 1
ERROR: compilation failed for package ‘lattice’
* removing ‘/home/mi/R/i686-pc-linux-gnu-library/3.2/lattice’
ERROR: dependency ‘lattice’ is not available for package ‘Matrix’
* removing ‘/home/mi/R/i686-pc-linux-gnu-library/3.2/Matrix’
ERROR: dependency ‘Matrix’ is not available for package ‘arules’
* removing ‘/home/mi/R/i686-pc-linux-gnu-library/3.2/arules’
The downloaded source packages are in
‘/tmp/RtmpIejCpM/downloaded_packages’
Warning messages:
1: In install.packages("arules") :
installation of package ‘lattice’ had non-zero exit status
2: In install.packages("arules") :
installation of package ‘Matrix’ had non-zero exit status
3: In install.packages("arules") :
installation of package ‘arules’ had non-zero exit status
>
[3]+ Stopped R
mi#MI:~$ R --version
R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
I am not understanding it how to resolve this error? Is this version or that packages no longer available?

Resources