Failed to install MetaboAnalystR

devtools::install_github(“xia-lab/MetaboAnalystR”, build = TRUE, build_vignettes = FALSE)
Downloading GitHub repo xia-lab/MetaboAnalystR@HEAD
:heavy_check_mark: checking for file ‘C:\Users\LJ JIN\AppData\Local\Temp\RtmpQzUlSf\remotes78b820f6e93\xia-lab-MetaboAnalystR-ffdb096/DESCRIPTION’ …
─ preparing ‘MetaboAnalystR’: (731ms)
:heavy_check_mark: checking DESCRIPTION meta-information …
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts (843ms)
─ checking for empty or unneeded directories
─ building ‘MetaboAnalystR_3.2.0.tar.gz’

Installing package into ‘C:/Users/LJ JIN/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)

  • installing source package ‘MetaboAnalystR’ …
    ** using staged installation
    ** libs
    rm -f fortran/decorana.o c/Internal_utils_batch.o c/util.o cpp/melt.o c/fastmatch.o c/nncgc.o c/mzROI.o c/xcms_binners.o Exports.o
    gfortran -fno-optimize-sibling-calls -O2 -mfpmath=sse -msse2 -mstackrealign -c fortran/decorana.f -o fortran/decorana.o
    gcc -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c c/Internal_utils_batch.c -o c/Internal_utils_batch.o
    c/Internal_utils_batch.c: In function ‘do_decorana’:
    c/Internal_utils_batch.c:114:3: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
    114 | for (i = 0, nid = 0; i < nr*nc; i++)
    | ^~~
    c/Internal_utils_batch.c:118:5: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
    118 | int *ibegin = (int *) R_alloc(nr, sizeof(int));
    | ^~~
    gcc -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c c/util.c -o c/util.o
    g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -fopenmp -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c cpp/melt.cpp -o cpp/melt.o
    cpp/melt.cpp:1:10: fatal error: Rcpp.h: No such file or directory
    1 | #include <Rcpp.h>
    | ^~~~~~~~
    compilation terminated.
    make: *** [C:/PROGRA~1/R/R-42~1.2/etc/x64/Makeconf:260: cpp/melt.o] Error 1
    ERROR: compilation failed for package ‘MetaboAnalystR’
  • removing ‘C:/Users/LJ JIN/AppData/Local/R/win-library/4.2/MetaboAnalystR’
    Warning message:
    In i.p(…) :
    installation of package ‘C:/Users/LJJIN~1/AppData/Local/Temp/RtmpQzUlSf/file78b866c8361/MetaboAnalystR_3.2.0.tar.gz’ had non-zero exit status

I do have already installed and loaded Rcpp.

I am running into this same issue!

Hi, I have run into the same error. But I installed it successfully using the option B after installation of all the required packages.

Option B) Install from a pre-built source package

install.packages("", repos = NULL, method = "wget")

Hi Lei, I tried to install through option B as you did, but i failed to intstall a depency package, “SSPA”. How did you install it? I’m now running R4.2.2 AND Bioconductor 3.16.
Below is the error message i received when i tried to install it:

Warning in install.packages :
package ‘SSPA’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at

Yes, I had got that warning, too. I have to download the SSPA_2.22.1.tar.gz package and installed it and its dependent packages manually.

I was able to manually install SSPA using:

make sure you have dev tools installed and loaded first

I am running R4.4.2 and bioconductor 3.16