0

Rstanarm seems to install normally. But attempting to load:

> library(rstanarm)
Error: package or namespace load failed for ‘rstanarm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘igraph’
In addition: Warning message:
package ‘rstanarm’ was built under R version 4.0.5 

Attempting to install igraph, I get a very long text ending with the following:

compilation terminated.
make: *** [C:/PROGRA~1/R/R-40~1.4/etc/i386/Makeconf:222: core/community/optimal_modularity.o] Error 1
ERROR: compilation failed for package 'igraph'
* removing 'C:/Users/siegl/OneDrive/Documents/R/win-library/4.0/igraph'
Warning in install.packages :
  installation of package ‘igraph’ had non-zero exit status

Older answers imply I need to install gfortran, but even after following the instructions here: https://masuday.github.io/fortran_tutorial/install_gfortran_windows.html and installing gfortran, that did not work either.

What should I do? Is gfortran off the directory path maybe? Typing gfortran into msys2 gets a fatal error that there are no input files, even though pacman -Su gcc-fortran installed it correctly

  • Please add some information about your OS. Are you under Linux? – nicola Oct 07 '22 at 07:52
  • The paths look like clear MS Windows. – Vladimir F Героям слава Oct 07 '22 at 10:51
  • Is there anything more in some log file? Some details about the compilation that failed? Are you able to execute `gfortran` in the command prompt? – Vladimir F Героям слава Oct 07 '22 at 10:52
  • 1
    OK, I see the *"Typing 'gfortran' into msys2 gets a fatal error that there are no input files"* now. That is what you want! It means gfortran is installed correctly and ready to compile your Fortran files. But since you supplied no such file, it does not compile anything. You really should look for some more specific details inside, some log file. Just the *"ERROR: compilation failed for package 'igraph'"* is insufficient, it does not really tell anything specific. – Vladimir F Героям слава Oct 07 '22 at 13:29
  • 1
    On Windows, you should not try to compile igraph from sources unless you know what you are doing. Use the binaries from CRAN. These require either the latest version of R (4.2) or the one before that (4.1). Make sure you have one of these, and try again. If it still does not work, edit the question and state: (1) the output of `R.version` (2) where you obtained R (3) the full output from `install.packages('igraph')` in a fresh session. – Szabolcs Oct 07 '22 at 13:39

1 Answers1

1

The correct answer was that I needed to update R to 4.2, as I have neglected to update for too long. Thank you Szabolcs.