Exploratory Chemometrics for Spectroscopy

A collection of functions for top-down exploratory data analysis of spectral data including nuclear magnetic resonance (NMR), infrared (IR), Raman, X-ray fluorescence (XRF) and other similar types of spectroscopy. Includes functions for plotting and inspecting spectra, peak alignment, hierarchical cluster analysis (HCA), principal components analysis (PCA) and model-based clustering. Robust methods appropriate for this type of high-dimensional data are available. ChemoSpec is designed for structured experiments, such as metabolomics investigations, where the samples fall into treatment and control groups. Graphical output is formatted consistently for publication quality plots. ChemoSpec is intended to be very user friendly and to help you get usable results quickly. A vignette covering typical operations is available.


ChemoSpec 5.0.229 2019-02-28


  • Unit tests added for .cleanArgs.

ChemoSpec 5.0.215 2018-12-06


  • files2SpectraObject can now accept any arguments to list.files or read.table via the ... mechanism. Arguments are sanitized more robustly. However, it is possible to pass arguments that may not be of real utility. For instance na.strings can be specified, but any NA in the data imported will trigger warnings and errors.


  • plotScree added to r_pcaSpectra example.

ChemoSpec 5.0.207 2018-11-28


  • files2SpectraObject can now accept optional arguments path and recursive to allow reading through a directory substructure. In addition, a progress bar is now displayed unless debug = TRUE. Both features suggested by Reinhard Kerschner along with preliminary code (thanks!).

ChemoSpec 5.0.193 2018-11-20

Bug Fixes

  • Fixed a problem with color assignment in .groupNcolor (the problem seems to have been present from the very beginning). Reported by Reinhard Kerschner (many thanks!). Note .groupNcolor now resides in ChemoSpecUtils. Reported here for convenience.


  • matrix2SpectraObject now uses tryCatch() to more gracefully fail and offer suggestions to user.
  • files2SpectraObject


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


6.1.0 by Bryan A. Hanson, 16 days ago


Report a bug at https://github.com/bryanhanson/ChemoSpec/issues

Browse source code at https://github.com/cran/ChemoSpec

Authors: Bryan A. Hanson [aut, cre] , Mike Bostock [cph, ctb] (author of the d3.js library used by plotSpectraJS , http://d3js.org) , Matt Keinsley [ctb] (author of initial AOV-PCA code) , Tejasvi Gupta [ctb] (author of ggplot2 and plotly graphics)

Documentation:   PDF Manual  

Task views: Chemometrics and Computational Physics

GPL-3 license

Imports plyr, stats, utils, grDevices, reshape2, readJDX, patchwork, ggplot2, plotly, magrittr

Depends on ChemoSpecUtils

Suggests IDPmisc, knitr, js, NbClust, lattice, baseline, mclust, pls, clusterCrit, R.utils, RColorBrewer, seriation, MASS, robustbase, grid, pcaPP, jsonlite, gsubfn, signal, speaq, tinytest, elasticnet, irlba, amap, rmarkdown, bookdown, chemometrics, httr, RCurl, mixOmics, hyperSpec, bootsPLS

Suggested by ChemoSpecUtils.

See at CRAN