Installing R

I ran the AFNI System Check and continued to get error messages about R package installations. Can I get some help in fixing this?

See the results below:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              5.15.146.1-microsoft-standard-WSL2
version:              #1 SMP Thu Jan 11 04:09:03 UTC 2024
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       16
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/useradd/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: May  2 2024
                     : AFNI_24.1.08 'Publius Septimius Geta'
AFNI_version.txt     : AFNI_24.1.08, linux_ubuntu_16_64, May 02 2024, official
which python         : /usr/bin/python
python version       : 3.10.12
which R              : /usr/bin/R
R version            : R version 4.1.2 (x86_64-pc-linux-gnu)

instances of various programs found in PATH:
    afni    : 1   (/home/useradd/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 1   (/usr/bin/python3.10)
    python2 : 0
    python3 : 1   (/usr/bin/python3.10)

** have python3 but not python2

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    uber_subject.py      : success
    3dMVM                : success

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh           : /usr/bin/tcsh
tcsh version         : 6.21.00
which Xvfb           : /usr/bin/Xvfb

checking for R packages...
    rPkgsInstall -pkgs ALL -check : FAILURE

        oo Warning:
           These packages are not installed on the computer: brms!


R RHOME : /usr/lib/R

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
   module file : /usr/lib/python3/dist-packages/matplotlib/pyplot.py
   matplotlib version : 3.5.1

++ module loaded: flask
   module file : /usr/lib/python3/dist-packages/flask/__init__.py
   flask version : 2.0.1

++ module loaded: flask_cors
   module file : /usr/lib/python3/dist-packages/flask_cors/__init__.py
   flask_cors version : 3.0.9

-------------------------------- env vars --------------------------------
PATH                       = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/laure/AppData/Local/Programs/Python/Python312/Scripts/:/mnt/c/Users/laure/AppData/Local/Programs/Python/Python312/:/mnt/c/Users/laure/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/laure/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Program Files/JetBrains/PyCharm 2023.3/bin:/mnt/c/Program Files/JetBrains/PyCharm Community Edition 2023.3.2/bin:/snap/bin:/home/useradd/abin

PYTHONPATH                 =
R_LIBS                     = /home/useradd/R
LD_LIBRARY_PATH            =
DYLD_LIBRARY_PATH          =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL                =
CONDA_DEFAULT_ENV          =

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

    .afnirc                   : found
    .sumarc                   : found
    .afni/help/all_progs.COMP : found

--------- shell startup files ----------

   -- good: .tcshrc seems to contain 'source .cshrc'
   -- considered operations: path, apsearch

   -- note: followers should not need edits, so edit flags should be 0
      (have 1 follower(s), which can be ignored)

   dot file test : want 1 modifications across 3 files:

      file             path  flatdir  apsearch        follower
      ---------------  ----  -------  --------        --------
      .cshrc           0     0        1               0
      .tcshrc          0     0        0               1
      .bashrc          0     0        0               0

------------------------------ data checks -------------------------------
data dir : found AFNI_data6   under $HOME (1031019M Avail)
           top history: ... 2024 [rickr]: 3drefit -newid FT/SUMA/FT_SurfVol.nii
data dir : found AFNI_demos   under $HOME
           top history: ...ct 2020 [taylorp]: updated scripts under FATCAT_DEMO
data dir : found suma_demo    under $HOME
           top history: ...s_New/data/Build_tmp on Mon Mar  4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas    : found TT_N27+tlrc  under /home/useradd/abin

------------------------------ OS specific -------------------------------
which apt-get        : /usr/bin/apt-get
apt-get version      : apt 2.4.12 (amd64)

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: May  2 2024

=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  missing R packages (see rPkgsInstall)
*  dot file test : want 1 modifications across 3 files:

Howdy-

If you run R on the command line, then in the environment that starts try running the install:

install.packages('brms')

... what happens?

--pt

Here is the output I get:

  • installing source package ‘Brobdingnag’ ...
    ** package ‘Brobdingnag’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error: package ‘Matrix’ 1.4.0 was found, but >= 1.5.0 is required by ‘Brobdingnag’
    Execution halted
    ERROR: lazy loading failed for package ‘Brobdingnag’
  • removing ‘/home/useradd/R/Brobdingnag’
    ERROR: dependency ‘Brobdingnag’ is not available for package ‘bridgesampling’
  • removing ‘/home/useradd/R/bridgesampling’
    ERROR: dependency ‘bridgesampling’ is not available for package ‘brms’
  • removing ‘/home/useradd/R/brms’

The downloaded source packages are in
‘/tmp/Rtmp2m4z8R/downloaded_packages’
Warning messages:
1: In install.packages("brms") :
installation of package ‘Brobdingnag’ had non-zero exit status
2: In install.packages("brms") :
installation of package ‘bridgesampling’ had non-zero exit status
3: In install.packages("brms") :
installation of package ‘brms’ had non-zero exit status

Try this:

install.packages('Matrix')
install.packages('brms')
install.packages('lme4')

Gang Chen

Seems like "lme4" was succesful but for the other 2, I get the following outputs:

install.packages('Matrix')
Warning message:
package ‘Matrix’ is not available for this version of R
‘Matrix’ version 1.7-0 is in the repositories but depends on R (>= 4.4.0)
‘Matrix’ version 1.7-0 is in the repositories but depends on R (>= 4.5)

install.packages('brms')
Warning messages:
1: In install.packages("brms") :
installation of package ‘Brobdingnag’ had non-zero exit status
2: In install.packages("brms") :
installation of package ‘bridgesampling’ had non-zero exit status
3: In install.packages("brms") :
installation of package ‘brms’ had non-zero exit status

install.packages('brms')
Installing package into ‘/home/useradd/R’
(as ‘lib’ is unspecified)
Warning: dependency ‘Matrix’ is not available
also installing the dependencies ‘Brobdingnag’, ‘bridgesampling’

Update your R first, and then execute the following in R:

install.packages('Matrix')
install.packages('brms')

Gang Chen

Thank you! It seems all I needed to do was to update the version of R I had in Ubuntu.