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

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?

Related

R installing package 'DescTools' - "gfortran no file or directory" error

I've tried to download the package "DescTools" and I'm getting an error message while installing the dependencies ('lmom', 'gld') which I cannot solve myself. It seems like "gfortran" is the problem, I've googled it but didn't get what to do.
I've get the error code below, would appreciate if anyone could help. Working on Mac OS X.
Thanks!
> install.packages("DescTools")
> Installing package into ‘/Users/XXX/Library/R/4.0/library’
> (as ‘lib’ is unspecified)
> also installing the dependencies ‘lmom’, ‘gld’
> There are binary versions available but the source versions are later:
> binary source needs_compilation
> lmom 2.8 2.9 TRUE
> gld 2.6.4 2.6.6 TRUE
> DescTools 0.99.44 0.99.47 TRUE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel) Yes
installing the source packages ‘lmom’, ‘gld’, ‘DescTools’
installing *source* package ‘lmom’ ...
\*\* package ‘lmom’ successfully unpacked and MD5 sums checked
\*\* using staged installation
\*\* libs
gfortran -mmacosx-version-min=10.13 -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c d1mach.f -o d1mach.o
make: gfortran: No such file or directory
make: \*\*\* \[d1mach.o\] Error 1
ERROR: compilation failed for package ‘lmom’
removing ‘/Users/XXX/Library/R/4.0/library/lmom’
Warning in install.packages :
installation of package ‘lmom’ had non-zero exit status
ERROR: dependency ‘lmom’ is not available for package ‘gld’
removing ‘/Users/XXX/Library/R/4.0/library/gld’
Warning in install.packages :
installation of package ‘gld’ had non-zero exit status
ERROR: dependency ‘gld’ is not available for package ‘DescTools’
removing ‘/Users/XXX/Library/R/4.0/library/DescTools’
Warning in install.packages :
installation of package ‘DescTools’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/fr/3xrgrwbd44vf58dqqtcml67h0000gn/T/RtmpOmArkk/downloaded_packages’

R packages failing to install

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.

Installing R package "validate" exits with error

I'm trying to install the package validate using install.package("validate"), but I get the following error message:
Installing package into ‘C:/Users/xxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
validate 0.9.3 1.0.1 TRUE
installing the source package ‘validate’
trying URL 'https://cran.rstudio.com/src/contrib/validate_1.0.1.tar.gz'
Content type 'application/x-gzip' length 1990096 bytes (1.9 MB)
downloaded 1.9 MB
* installing *source* package 'validate' ...
** package 'validate' successfully unpacked and MD5 sums checked
** using staged installation
** libs
*** arch - i386
C:/Program Files/R-Tools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-3.6.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c R_fdep.c -o R_fdep.o
sh: C:/Program: No such file or directory
make: *** [C:/PROGRA~1/R/R-3.6.1/etc/i386/Makeconf:208: R_fdep.o] Error 127
ERROR: compilation failed for package 'validate'
* removing 'C:/Users/xxx/Documents/R/win-library/3.6/validate'
* restoring previous 'C:/Users/xxx/Documents/R/win-library/3.6/validate'
Warning in install.packages :
installation of package ‘validate’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\xxx\AppData\Local\Temp\2\Rtmp08xXa8\downloaded_packages’
I've tried installing the package on my local machine and there I have no issues. This issues occurs when I try installing the package on a Azure-Cloud. Other packages install fine however. Also when I install the package using the "binary" option, it works fine... That is, howeverm, not the most recent version and there are some functionallities we want to use from the newest version.
Has anyone else encountered this problem and has a solution?
With the Help of user20650 I was able to find a solution.
We have an older version of R and R-Studio installed on our Cloud. This causes issues when installing packages with install.packages. Apparently only the newest source-file, but not the newest binary is considered. To overcome this I needed to download the binary manualy from cran. Then I installed the binary in R-Studio using Tools -> Install Packages... -> Install from: Package Archive file -> select Binary

Trouble updating dplyr package in r

I am having trouble updating several packages in rStudio. My Macbook is up to date and my rStudio is also up to date.
Please help me figure out how to fix it.
Kind Regards
Here is a snippit of my rStudio terminal trying to update the "dplyr" package
>install.packages("dplyr")
There is a binary version available but the source version is later:
binary source needs_compilation
dplyr 0.8.0.1 0.8.5 TRUE
Do you want to install from sources the package which needs compilation?
y/n: y
installing the source package ‘dplyr’
trying URL 'https://cran.rstudio.com/src/contrib/dplyr_0.8.5.tar.gz'
Content type 'application/x-gzip' length 1378766 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
* installing *source* package ‘dplyr’ ...
** package ‘dplyr’ successfully unpacked and MD5 sums checked
** libs
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -\ ^
1 warning and 5 errors generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘dplyr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/dplyr’
Warning in install.packages :
installation of package ‘dplyr’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/p5/7cr4ncpx38s_0trbs9966_8w0000gn/T/RtmpHMQzDX/downloaded_packages’
>

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

Resources