ChemoSpec: Exploratory Chemometrics for Spectroscopy

A collection of functions for top-down exploratory data analysis of spectral data obtained via nuclear magnetic resonance (NMR), infrared (IR) or Raman 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 with metabolomics data sets in mind, where the samples fall into groups such as treatment and control. Graphical output is formatted consistently for publication quality plots. ChemoSpec is intended to be very user friendly and help you get usable results quickly. A vignette covering typical operations is available.

Install the latest version of this package by entering the following in R:
AuthorBryan A. Hanson [aut, cre], Mike Bostock [cph, ctb] (author of the d3.js library used in plotSpectraJS,
Date of publication2017-02-13 23:41:34
MaintainerBryan A. Hanson <>

View on CRAN

Man pages

aovPCAloadings: Plot aovPCAscores Loadings of a Spectra Object

aovPCAscores: Plot ANOVA-PCA Scores from a Spectra Object

aov_pcaSpectra: ANOVA-PCA Analysis of Spectra Data

avgFacLvls: Average Levels of a Factor in a Data Matrix

baselineSpectra: Baseline Correction of a Spectra Object

binData: Bin or Bucket Data

binSpectra: Bin or Bucket a Spectra Object

check4Gaps: Check for Missing Values (Gaps) in a Spectra Object

ChemoSpec-package: Exploratory Chemometrics for Spectroscopy

chkSpectra: Verify the Integrity of a Spectra Object

clupaSpectra: Hierarchical Cluster-Based Peak Alignment on a Spectra Object

colLeaf: Color the Leaves of a Dendrogram Based on a Spectra Object

colorSymbol: Colors and Symbols in ChemoSpec and Spectra Objects

conColScheme: Change the Color Scheme of a Spectra Object

coordProjCS: Modified Version of coordProj from mclust

c_pcaSpectra: Classical PCA of Spectra Objects

cv_pcaSpectra: Cross-Validation of Classical PCA Results for a Spectra...

evalClusters: Evaluate or Compare the Quality of Clusters Quantitatively

files2SpectraObject: Import Data into a Spectra Object

groupNcolor: Assign Group Membership and Colors for a Spectra Object

hcaScores: HCA on PCA scores from a Spectra Object

hcaSpectra: Plot HCA Results of a Spectra Object

hmapSpectra: Seriated Heat Map for a Spectra Object

hypTestScores: Conduct MANOVA using PCA Scores and Factors in a Spectra...

isWholeNo: Determine if a Number is a Whole Number

labelExtremes: Label Extreme Values in a 2D Data Set

labelExtremes3d: Identify Extreme Values in 3D

loopThruSpectra: Display the Spectra in a Spectra Object One at a Time

makeEllipsoid: Create Ellipsoid

mclust3D: mclust Analysis in 3D

mclust3dSpectra: mclust Analysis of a Spectra Object in 3D

mclustSpectra: mclust Analysis of a Spectra Object PCA Results

metMUD1: Made Up NMR Data Sets

normSpectra: Normalize a Spectra Object

normVec: Normalize a Vector to range -1 to +1

pcaDiag: Outlier Diagnostic Plots for PCA of a Spectra Object

plot2Loadings: Plot PCA Loadings from a Spectra Object Against Each Other

plotHCA: Plot Dendrogram for Spectra Object

plotLoadings: Plot PCA Loadings for a Spectra Object

plotScores: Plot PCA Scores of a Spectra Object

plotScores3D: 3D PCA Score Plot for a Spectra Object

plotScoresCor: Compute Confidence Ellipses

plotScoresDecoration: Decorate PCA Score Plot of a Spectra Object

plotScoresRGL: Interactive 3D Score Plot of a Spectra Object

plotScree: Scree Plots of PCA Results for a Spectra Object

plotSpectra: Plot Spectra Object

plotSpectraDist: Plot the Distance Between Spectra in a Spectra Object

plotSpectraJS: Plot a Spectra Object Interactively

q2rPCA: Conversion Between PCA Classes

removeFreq: Remove Frequencies from a Spectra Object

removeGroup: Remove Groups or Samples from a Spectra Object

rowDist: Compute Distance Between Rows of a Matrix

r_pcaSpectra: Robust PCA of a Spectra Object

sampleDistSpectra: Compute the Distance Between Samples in a Spectra Object

seXy: Functions to Compute Measures of Central Tendency and Spread....

sgfSpectra: Apply Savitzky-Golay filters to a Spectra object

shrinkLeaf: Shrink the Leaves of a Dendrogram Based on a Spectra Object

Spectra: Spectra Objects

splitSpectraGroups: Create New Groups from an Existing Spectra Object

sPlotSpectra: s-Plot of Spectra Data (Post PCA)

SrE.IR: IR and NMR Spectra of Serenoa repens (Saw Palmetto) Oil...

sumGroups: Summarize the Group Parameters of a Spectra Object

sumSpectra: Summarize a Spectra Object

surveySpectra: Plot Measures of Central Tendency and Spread for a Spectra...


alignMUD Man page
aovPCAloadings Man page
aovPCAscores Man page
aov_pcaSpectra Man page
avgFacLvls Man page
baselineSpectra Man page
binData Man page
binSpectra Man page
check4Gaps Man page
ChemoSpec Man page
ChemoSpec-package Man page
chkSpectra Man page
clupaSpectra Man page
colLeaf Man page
colorSymbol Man page
conColScheme Man page
coordProjCS Man page
c_pcaSpectra Man page
cv_pcaSpectra Man page
evalClusters Man page
files2SpectraObject Man page
groupNcolor Man page
hcaScores Man page
hcaSpectra Man page
hmapSpectra Man page
hypTestScores Man page
isWholeNo Man page
labelExtremes Man page
labelExtremes3d Man page
loopThruSpectra Man page
makeEllipsoid Man page
matrix2SpectraObject Man page
mclust3D Man page
mclust3dSpectra Man page
mclustSpectra Man page
metMUD1 Man page
metMUD2 Man page
normSpectra Man page
normVec Man page
pcaDiag Man page
plot2Loadings Man page
plotHCA Man page
plotLoadings Man page
plotScores Man page
plotScores3D Man page
plotScoresCor Man page
plotScoresDecoration Man page
plotScoresRGL Man page
plotScree Man page
plotScree2 Man page
plotSpectra Man page
plotSpectraDist Man page
plotSpectraJS Man page
q2rPCA Man page
r2qPCA Man page
removeFreq Man page
removeGroup Man page
removeSample Man page
rowDist Man page
r_pcaSpectra Man page
sampleDistSpectra Man page
seX Man page
seXy Man page
seXy95 Man page
seXyIqr Man page
seXyMad Man page
sgfSpectra Man page
shrinkLeaf Man page
Spectra Man page
splitSpectraGroups Man page
sPlotSpectra Man page
SrE.IR Man page
SrE.NMR Man page
sumGroups Man page
sumSpectra Man page
surveySpectra Man page
surveySpectra2 Man page


R/sumGroups.R R/surveySpectra.R R/removeFreq.R R/readJEOLascii.R R/conColScheme.R R/LoopThruSpectra.R R/hcaSpectra.R R/Spectra.R R/removeSample.R R/aov_pcaSpectra.R R/matrix2SpectraObject.R R/chkSpectra.R R/isWholeNo.R R/mclustSpectra.R R/cv_pcaSpectra.R R/pcaDiag.R R/plotScores3D.R R/baselineSpectra.R R/plotScree2.R R/labelExtremes.R R/seXy.R R/hypTestScores.R R/files2SpectraObject.R R/plotScoresDecoration.R R/aovPCAscores.R R/sPlotSpectra.R R/mclust3D.R R/ChemoSpec-package.R R/hmapSpectra.R R/groupNcolor.R R/colLeaf.R R/r_pcaSpectra.R R/plotScoresCor.R R/plot2Loadings.R R/hcaScores.R R/r2qPCA.R R/plotScores.R R/mclust3dSpectra.R R/evalClusters.R R/MUD.R R/binData.R R/plotScree.R R/removeGroup.R R/SrE.R R/coordProjCS.R R/plotSpectra.R R/c_pcaSpectra.R R/aovPCAloadings.R R/splitSpectraGroups.R R/sumSpectra.R R/makeEllipsoid.R R/shrinkLeaf.R R/surveySpectra2.R R/avgFacLvls.R R/plotLoadings.R R/colorSymbol.R R/plotScoresRGL.R R/q2rPCA.R R/normSpectra.R R/binSpectra.R R/plotSpectraJS.R R/clupaSpectra.R R/check4Gaps.R R/plotSpectraDist.R R/sgfSpectra.R R/normVec.R R/rowDist.R R/plotHCA.R R/sampleDistSpectra.R R/labelExtremes3d.R
man/metMUD1.Rd man/sumGroups.Rd man/avgFacLvls.Rd man/rowDist.Rd man/cv_pcaSpectra.Rd man/conColScheme.Rd man/colorSymbol.Rd man/seXy.Rd man/removeFreq.Rd man/q2rPCA.Rd man/hmapSpectra.Rd man/plotSpectraDist.Rd man/binData.Rd man/plotLoadings.Rd man/labelExtremes3d.Rd man/loopThruSpectra.Rd man/sPlotSpectra.Rd man/aovPCAscores.Rd man/mclustSpectra.Rd man/plotSpectraJS.Rd man/chkSpectra.Rd man/check4Gaps.Rd man/clupaSpectra.Rd man/sampleDistSpectra.Rd man/makeEllipsoid.Rd man/plot2Loadings.Rd man/plotScoresDecoration.Rd man/evalClusters.Rd man/sgfSpectra.Rd man/aov_pcaSpectra.Rd man/mclust3dSpectra.Rd man/surveySpectra.Rd man/sumSpectra.Rd man/aovPCAloadings.Rd man/plotScoresCor.Rd man/SrE.IR.Rd man/plotScores3D.Rd man/colLeaf.Rd man/plotHCA.Rd man/binSpectra.Rd man/baselineSpectra.Rd man/hcaSpectra.Rd man/normSpectra.Rd man/Spectra.Rd man/hcaScores.Rd man/mclust3D.Rd man/files2SpectraObject.Rd man/ChemoSpec-package.Rd man/groupNcolor.Rd man/isWholeNo.Rd man/c_pcaSpectra.Rd man/pcaDiag.Rd man/plotSpectra.Rd man/coordProjCS.Rd man/removeGroup.Rd man/normVec.Rd man/labelExtremes.Rd man/plotScoresRGL.Rd man/hypTestScores.Rd man/splitSpectraGroups.Rd man/plotScores.Rd man/plotScree.Rd man/r_pcaSpectra.Rd man/shrinkLeaf.Rd

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.