Unable to Install "fBasic"

Hi, I am a student trying to install fBasic, but I am unable to install gss for some reason and keep getting this error.

install.packages("fBasics")
also installing the dependency ‘gss’

Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
Packages which are only available in source form, and may need compilation of
C/C++/Fortran: ‘gss’ ‘fBasics’

Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source packages ‘gss’, ‘fBasics’
trying URL 'https://cran.rstudio.com/src/contrib/gss_2.2-10.tar.gz'
Content type 'application/x-gzip' length 545241 bytes (532 KB)

downloaded 532 KB

trying URL 'https://cran.rstudio.com/src/contrib/fBasics_4052.98.tar.gz'
Content type 'application/x-gzip' length 939038 bytes (917 KB)

downloaded 917 KB

  • installing source package ‘gss’ ...
    ** package ‘gss’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    /opt/R/arm64/bin/gfortran -mtune=native -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c cdennewton.f -o cdennewton.o
    make: /opt/R/arm64/bin/gfortran: No such file or directory
    make: *** [cdennewton.o] Error 1
    ERROR: compilation failed for package ‘gss’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/gss’
    ERROR: dependency ‘gss’ is not available for package ‘fBasics’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/fBasics’

The downloaded source packages are in
‘/private/var/folders/71/5w802pcj76sf5_h2xx4ncwtc0000gn/T/RtmpisMjWc/downloaded_packages’
Warning messages:
1: In utils::install.packages("fBasics") :
installation of package ‘gss’ had non-zero exit status
2: In utils::install.packages("fBasics") :
installation of package ‘fBasics’ had non-zero exit status

You are using an older version of R, for which CRAN apparently has no binary packages available, so you need to install them from source. This requires a fortran compiler, and maybe more system packages.

I would try to install gfortran from here first (the pkg file): Releases · R-macos/gcc-14-branch · GitHub

Alternatively you can upgrade your R installation, and then you don't need to compile packages from source.

Installation errors with fBasics are usually because it depends on timeDate and timeSeries. Have you tried installing those two first? Also, if you’re on Windows, make sure you have Rtools installed - sometimes the binary isn't available for the latest R version, and it tries (and fails) to build from source without it.