Issues with installing caret package of R in archlinux - r

I am trying to install the package caret in R for sometime now, and I am getting this error message:
*installing *source* package ‘minqa’ ...
** package ‘minqa’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -c altmov.f -o altmov.o
make: gfortran: Command not found
make: *** [altmov.o] Error 127
/usr/lib64/R/etc/Makeconf:155: recipe for target 'altmov.o' failed
ERROR: compilation failed for package ‘minqa’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/minqa’
Warning in install.packages :
installation of package ‘minqa’ had non-zero exit status
* installing *source* package ‘SparseM’ ...
** package ‘SparseM’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -c bckslv.f -o bckslv.o
make: gfortran: Command not found
/usr/lib64/R/etc/Makeconf:155: recipe for target 'bckslv.o' failed
make: *** [bckslv.o] Error 127
ERROR: compilation failed for package ‘SparseM’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/SparseM’
Warning in install.packages :
installation of package ‘SparseM’ had non-zero exit status
ERROR: dependency ‘minqa’ is not available for package ‘lme4’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/lme4’
Warning in install.packages :
installation of package ‘lme4’ had non-zero exit status
ERROR: dependency ‘SparseM’ is not available for package ‘quantreg’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/quantreg’
Warning in install.packages :
installation of package ‘quantreg’ had non-zero exit status
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/pbkrtest’
Warning in install.packages :
installation of package ‘pbkrtest’ had non-zero exit status
ERROR: dependencies ‘pbkrtest’, ‘quantreg’ are not available for package ‘car’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/car’
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
ERROR: dependency ‘car’ is not available for package ‘caret’
* removing ‘/home/mohammad/R/x86_64-pc-linux-gnu-library/3.3/caret’
Warning in install.packages :
installation of package ‘caret’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpVBZAgE/downloaded_packages’
Now according to some of the post, I tried to install minqa,SparseM, lme4,car ... separately. Its not installing properly. The main problem that I suspect is the absence of gfortran library in my archlinux. I tried to find the package gfortran in arch repository using pacman. It is not present there, so in the end I am just stuck. Does anybody has a solution or faced this problem before. Thanks.

I had a similar problem. For anyone else with this problem this is the package you need to install. It is gcc-fortran 6.2.1-1
To install it:
sudo pacman -S gcc-fortran
https://www.archlinux.org/packages/core/x86_64/gcc-fortran/

Related

clang error trying to install R package `ivreg` on mac

I am attempting to install the ivreg package into R (4.0.3) on my Mac (OS Big Sur Intel Version 11.6.8)
I am having what apparently is a fairly common problem installing its dependencies, but I am receiving a slightly different error message. My error message from the command install.packages('ivreg'):
clang: error: -E or -x required when input is from standard input
clang: error: no such file or directory: 'L/usr/local/gfortran/lib'
make: *** [Matrix.so] Error 1
ERROR: compilation failed for package ‘Matrix’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Matrix’
* restoring previous
‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Matrix’
Warning in install.packages :
installation of package ‘Matrix’ had non-zero exit status
* installing *source* package ‘MatrixModels’ ...
** package ‘MatrixModels’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘Matrix’ 1.2-18 is being loaded, but >= 1.4.2 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘MatrixModels’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/MatrixModels’
Warning in install.packages :
installation of package ‘MatrixModels’ had non-zero exit status
ERROR: dependency ‘MatrixModels’ is not available for package ‘quantreg’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/quantreg’
Warning in install.packages :
installation of package ‘quantreg’ had non-zero exit status
ERROR: dependency ‘quantreg’ is not available for package ‘car’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/car’
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
The instrumental bit appears to be the very first two lines, where it's describing something about a gfortran directory. I've tried to install gfortran as well as all of the other dependencies to no avail. When I attempt to do so, I'm told that the packages are unavailable for my version of R.
QUESTION: Is there a way to alleviate this error and install ivreg on my machine?

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’

Installing factoextra package in R

I am using R version >3.5. I want to install factoextra package on R studio (I use Mac). I tried to install the package directly with dependencies = TRUE, and I also tried to install the dependencies packages one by one. Neither worked.
Here is the error message: (* represents the user on my computer).
* installing *source* package ‘quantreg’ ...
** package ‘quantreg’ successfully unpacked and MD5 sums checked
** libs
/Users/*/.R/Makevars:2: *** missing separator. Stop.
ERROR: compilation failed for package ‘quantreg’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/quantreg’
* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked and MD5 sums checked
** libs
/Users/*/.R/Makevars:2: *** missing separator. Stop.
ERROR: compilation failed for package ‘mclust’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mclust’
ERROR: dependencies ‘pbkrtest’, ‘quantreg’ are not available for package ‘car’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/car’
ERROR: dependency ‘car’ is not available for package ‘rstatix’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rstatix’
ERROR: dependency ‘rstatix’ is not available for package ‘ggpubr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ggpubr’
ERROR: dependency ‘ggpubr’ is not available for package ‘factoextra’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/factoextra’
The downloaded source packages are in:
‘/private/var/folders/8v/mfj4t9t54y72cdrz6q84jnjh0000gn/T/RtmpfEwO54/downloaded_packages’
Warning messages:
1: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘quantreg’ had non-zero exit status
2: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘mclust’ had non-zero exit status
3: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘car’ had non-zero exit status
4: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘rstatix’ had non-zero exit status
5: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘ggpubr’ had non-zero exit status
6: In install.packages("factoextra", dependencies = TRUE) :
installation of package ‘factoextra’ had non-zero exit status
any help would be greatly appreciated!!
R packages come in two shapes: as pre-compiled binaries, and as source code. In your case, it seems that the compilation of mclust and quantreg failed, as suggested by the error message
Stop. ERROR: compilation failed for package ‘mclust’
Stop. ERROR: compilation failed for package ‘quantreg’
You could try to force install them from binary by running: install.packages("mclust", type = "binary") and install.packages("quantreg", type = "binary")

Errors installing 'forecast' package in R version 3.3.2

Trying to install 'forecast' package in R version 3.3.2 on MacOS Sierra as follows:
install.packages("forecast")
Getting a slew of errors I don't understand. First it downloads all dependency packages from http://cloud.r-project.org. First error I get is this:
* installing *source* package ‘quadprog’ ...
** package ‘quadprog’ successfully unpacked and MD5 sums checked
** libs
gfortran -arch x86_64 -fPIC -g -O2 -c aind.f -o aind.o
make: gfortran: No such file or directory
make: *** [aind.o] Error 1
ERROR: compilation failed for package ‘quadprog’
* removing ‘/Users/ekorne201/Library/R/3.3/library/quadprog’
It then moves on to:
* installing *source* package ‘fracdiff’ ...
** package ‘fracdiff’ successfully unpacked and MD5 sums checked
After which it says:
ld: warning: directory not found for option '-L/Users/Shared/Jenkins/workspace/External-R-3.3.2/vendor/build/lib'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [fracdiff.so] Error 1
ERROR: compilation failed for package ‘fracdiff’
* removing ‘/Users/ekorne201/Library/R/3.3/library/fracdiff’
Goes through the same thing for 'lmtest' and 'RcppArmadillo', after which it ends with:
ERROR: dependencies ‘tseries’, ‘fracdiff’, ‘lmtest’, ‘RcppArmadillo’ are not available for package ‘forecast’
* removing ‘/Users/ekorne201/Library/R/3.3/library/forecast’
The downloaded source packages are in
‘/private/var/folders/8p/54qnlb9x7bj8syz631_d58t92rmkyp/T/Rtmp246ipQ/downloaded_packages’
Warning messages:
1: In install.packages("forecast") :
installation of package ‘quadprog’ had non-zero exit status
2: In install.packages("forecast") :
installation of package ‘fracdiff’ had non-zero exit status
3: In install.packages("forecast") :
installation of package ‘lmtest’ had non-zero exit status
4: In install.packages("forecast") :
installation of package ‘RcppArmadillo’ had non-zero exit status
5: In install.packages("forecast") :
installation of package ‘tseries’ had non-zero exit status
6: In install.packages("forecast") :
installation of package ‘forecast’ had non-zero exit status
Stuck on how to proceed and would appreciate the advice.
I got the same error. I solved it by installing the gfortran. In macOS, I can do it such that
brew install gcc
and in R such that
install.packages("forecast")
so
> library(forecast); fit <- tbats(UScitiesD);
> fit
BATS(0.566, {0,2}, -, -)
Call: tbats(y = UScitiesD)
Parameters
Lambda: 0.565592
Alpha: 0.2166945
MA coefficients: -0.130506 -0.511551
Seed States:
[,1]
[1,] 90.10291
[2,] 0.00000
[3,] 0.00000
Sigma: 27.61468
AIC: 761.9238
As mentioned in comments, other method is to install it from here.
Related
Does installing gfortran with homebrew and with an installer create a conflict?

Error in installing package hydroTSM on Mac OS X 10.9.5 - R (version 3.1.2)

I have searched for hints to my problem and made some progress through hints from similar posts, but ultimately still stuck. I am trying to install the package hydroTSM on a Mac (OS X 10.9.5). Using R Studio I successfully installed and loaded the most recent zoo and xts packages (dependencies). I tried:
install.packages("hydroTSM", lib="/Library/Frameworks/R.framework/Versions/3.1/Resources/library", type="source")
and it the install seems to proceed Ok until it gets to installing the rgeos package, and I get:
* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: clang
configure: CXX: clang++
configure: rgeos: 0.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 460
checking geos-config usability...
./configure: line 2056: geos-config: command not found
no
configure: error: geos-config not usable
ERROR: configuration failed for package ‘rgeos’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rgeos’
Warning in install.packages :
installation of package ‘rgeos’ had non-zero exit status
ERROR: dependency ‘rgeos’ is not available for package ‘spacetime’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/spacetime’
Warning in install.packages :
installation of package ‘spacetime’ had non-zero exit status
ERROR: dependency ‘spacetime’ is not available for package ‘gstat’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/gstat’
Warning in install.packages :
installation of package ‘gstat’ had non-zero exit status
ERROR: dependency ‘gstat’ is not available for package ‘automap’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/automap’
Warning in install.packages :
installation of package ‘automap’ had non-zero exit status
ERROR: dependencies ‘gstat’, ‘automap’ are not available for package ‘hydroTSM’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/hydroTSM’
Warning in install.packages :
installation of package ‘hydroTSM’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/87/wn7lf03j7w39zjtnslph4lj80000gn/T/RtmpZ7UFC7/downloaded_packages’ "
Any suggestions greatly appreciated.

Resources