Open Specy

Analyze, Process, Identify, and Share, Raman and (FT)IR Spectra

CRAN version Project Status R-CMD-check License: CC BY 4.0 DOI Website Twitter Follow

Raman and (FT)IR spectral analysis tool for plastic particles and other environmental samples (Cowger et al. 2021, doi: 10.1021/acs.analchem.1c00123). Supported features include reading spectral data files (.asp, .csv, .jdx, .spc, .spa, .0), Savitzky-Golay smoothing of spectral intensities with smooth_intens(), correcting background noise with subtr_bg() in accordance with Zhao et al. (2007, doi: 10.1366/000370207782597003), and identifying spectra using an onboard reference library (Cowger et al. 2020, doi: 10.1177/0003702820929064). Analyzed spectra can be shared with the Open Specy community. A Shiny app is available via run_app() or online at


OpenSpecy is available from CRAN and GitHub.

Install from CRAN (stable version)

You can install the latest release of OpenSpecy from CRAN with:


Install from GitHub (development version)

To install the development version of this package, paste the following code into your R console (requires devtools):

if (!require(devtools)) install.packages("devtools")

Getting started


See package vignette for a detailed standard operating procedure.



# Fetch current spectral library from

# Load library into global environment
spec_lib <- load_lib()

# Read sample spectrum
raman_hdpe <- read_text(read_extdata("raman_hdpe.csv"))

# Share your spectrum with the Open Spey community
           metadata = c(user_name = "Win Cowger",
                        contact_info = "",
                        spectrum_type = "Raman",
                        spectrum_identity = "HDPE")

# Adjust spectral intensity
raman_adj <- raman_hdpe %>%

# Smooth and background-correct spectrum
raman_proc <- raman_adj %>% 
  smooth_intens() %>% 

# Match spectrum with library and retrieve meta data
match_spec(raman_proc, library = spec_lib, which = "raman")

find_spec(sample_name == 5381, library = spec_lib, which = "raman")


Cowger W, Steinmetz Z, Gray A, Munno K, Lynch J, Hapich H, Primpke S, De Frond H, Rochman C, Herodotou O (2021). “Microplastic Spectral Classification Needs an Open Source Community: Open Specy to the Rescue!” Analytical Chemistry. doi: 10.1021/acs.analchem.1c00123.

Cowger W, Steinmetz Z (2021). “OpenSpecy: Analyze, Process, Identify, and Share, Raman and (FT)IR Spectra.” R package version 0.9.2.