Introducing the spectrakit R package
If you regularly work with spectral data, you’ve probably run into the same
set of challenges: producing clear spectral plots, combining data from
multiple files, applying consistent normalization, explore patterns in the
data, and assembling publication-ready figures. The spectrakit R
package is designed to streamline this entire workflow.
At its core, spectrakit provides a small set of focused tools for
handling, analyzing and visualizing spectral data, from raw files all the way
to final figures.
What spectrakit does
The package covers four common tasks:
- Visualizing spectra with flexible plotting options
- Combining spectra from multiple files into a single dataset
- Supporting exploration of spectral data using principal component analysis (PCA)
- Creating composite figures for publication-ready output
A simple workflow
A typical workflow with spectrakit might look like:
- Plotting spectra for exploration or reporting
- Merge and normalize multiple spectra
- Analyze the spectral data with PCA
- Assemble final figures for publication
The package is designed so these steps work smoothly together, reducing the
need for custom scripts or manual adjustments.
The four core functions
This blog series walks through each of the main functions in detail:
plotSpectra()– create customizable spectral visualizationscombineSpectra()– merge and normalize spectral datasetsplotPCA()– explore patterns via principal component analysismakeComposite()– build labeled image grids for publication
Each function gets its own post with examples and tips.
Where to start
If you’re new to the package, the best place to begin is with:
plotSpectra() – to turn your spectral data into clear, customizable visualizations
From there, you can move on to data handling and analysis, or figure
creation depending on your workflow.
Final thoughts
The goal of spectrakit is simple: make common spectral data tasks
faster, cleaner and more reproducible. Instead of stitching together
multiple tools, you get a compact, consistent toolkit built around real
analysis workflows.
About the author
Gianluca Pastorelli is a Heritage Scientist (Senior Researcher) working at the National Gallery of Denmark (SMK).




Comments
Post a Comment