1
votes

I am trying to install packages - party with its dependencies mtvnorm, multcomp, coin and party however when running the script - install.packages("party") I get this error: also installing the dependencies ‘multcomp’, ‘mvtnorm’, ‘coin’

trying URL 'https://cran.rstudio.com/src/contrib/multcomp_1.4-6.tar.gz' Content type 'application/x-gzip' length 606470 bytes (592 KB)

installing source package ‘mvtnorm’ ... ** package ‘mvtnorm’ successfully unpacked and MD5 sums checked ** libs clang -I/Users/feliperuiz/anaconda/lib/R/include -DNDEBUG -I/Users/feliperuiz/anaconda/include -fPIC -I/Users/feliperuiz/anaconda/include -c C_FORTRAN_interface.c -o C_FORTRAN_interface.o clang -I/Users/feliperuiz/anaconda/lib/R/include -DNDEBUG -I/Users/feliperuiz/anaconda/include -fPIC -I/Users/feliperuiz/anaconda/include -c miwa.c -o miwa.o gfortran -fPIC -I/Users/feliperuiz/anaconda/include -L/Users/feliperuiz/anaconda/lib -c mvt.f -o mvt.o make: gfortran: No such file or directory make: *** [mvt.o] Error 1 ERROR: compilation failed for package ‘mvtnorm’ removing ‘/Users/feliperuiz/anaconda/lib/R/library/mvtnorm’ Warning in install.packages : installation of package ‘mvtnorm’ had non-zero exit status ERROR: dependency ‘mvtnorm’ is not available for package ‘multcomp’ removing ‘/Users/feliperuiz/anaconda/lib/R/library/multcomp’ Warning in install.packages : installation of package ‘multcomp’ had non-zero exit status ERROR: dependencies ‘mvtnorm’, ‘multcomp’ are not available for package ‘coin’ removing ‘/Users/feliperuiz/anaconda/lib/R/library/coin’ Warning in install.packages : installation of package ‘coin’ had non-zero exit status ERROR: dependencies ‘mvtnorm’, ‘coin’ are not available for package ‘party’ removing ‘/Users/feliperuiz/anaconda/lib/R/library/party’ Warning in install.packages : installation of package ‘party’ had non-zero exit status The downloaded source packages are in ‘/private/var/folders/34/ydtmhytx0hj33tlmstcdrxsc0000gn/T/RtmptjKdvN/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done

have searched and read other installation error regarding other packages and their dependence nothing on party. I read yet those steps don't apply to my particular situation. I have removed other versions of r studio w/o anaconda, r, because I felt that maybe some files got corrupted. I don't know how to access the private/var/folder/34... what it means????

I am working on using classification to predict, my system is a macOS Sierra ver 10.12 using R studio with Anaconda.

1
There's a nice blog post I can't locate at the moment, but basically you need to install gfortran. R is very particular about the version, so it's simplest just to install it directly from the version linked on CRAN. - alistaire
gcc.gnu.org/wiki/GFortranBinaries - Phil
MacOS The gfortran maintainers offer nice Apple-style installers for: macOS Sierra (10.12): download gfortran 6.3 - Phil
installed gfortrain - I found the ver for my macOS Sierra - Phil
installed and load the party package with - library(party) at the console got the following message : Loading required package: grid Loading required package: mvtnorm Loading required package: modeltools Loading required package: stats4 Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich - Phil

1 Answers

0
votes

Felipe,

For future readers of this problem:

  • R Packages may be distributed in source form or compiled binary form. Installing source packages which contain C/C++/Fortran code requires that compilers and related tools be installed if no binary form can be found in the CRAN repository.

thus when you see a combination of these words when installing an R package on MAC OS X:

ERROR / installing source package / FORTRAN

it is highly likely you have not got Fortran installed.

nb. This will trigger a need to install Mac OSX Xcode.

Direct Install of R on Mac OSX

The following link shows the steps etc.

I hope the above is useful for future reference of the error and resolution path.

Anaconda / Conda

If you are using Anaconda / Conda for R package management you can also use conda to install GFortran: Personally, I prefer to install directly above.

conda install -c r r-essentials
conda install -c uvcdat gfortran=4.9.3

Ref: