Package: specProc 0.8.3

Christian L. Goueguel

specProc: Preprocessing Tools for Laser-Induced Breakdown Spectroscopy

Tools for exploring, preprocessing and modeling spectroscopic data, developed for laser-induced breakdown spectroscopy (LIBS) and also applicable to other techniques such as Raman, infrared, and inductively coupled plasma optical emission spectroscopy. Covers the workflow from raw spectra to calibrated results: peak finding and fitting, wavelength calibration, baseline correction, normalization and scaling, orthogonal signal correction including orthogonal partial least squares (OPLS; Trygg and Wold (2002) <doi:10.1002/cem.695>), calibration transfer, calibration curves and figures of merit, and plasma diagnostics (Boltzmann and Saha-Boltzmann plots, Stark broadening). Includes robust tools for outlier detection and exploration: robust principal component analysis (Hubert, Rousseeuw and Vanden Branden (2005) <doi:10.1198/004017004000000563>), detection of deviating cells (Rousseeuw and Van den Bossche (2018) <doi:10.1080/00401706.2017.1340909>), PCA with cellwise outliers and missing values (MacroPCA; Hubert, Rousseeuw and Van den Bossche (2019) <doi:10.1080/00401706.2018.1562989>), robust transformations to central normality (Raymaekers and Rousseeuw (2021) <doi:10.1007/s10994-021-05960-5>), and self-organizing maps (Kohonen (1982) <doi:10.1007/BF00337288>). Preprocessing steps are also available as 'recipes' steps for 'tidymodels' workflows. Computationally intensive steps are implemented in 'C++' via 'Rcpp' and 'RcppEigen'.

Authors:Christian L. Goueguel [aut, cre]

specProc_0.8.3.tar.gz
specProc_0.8.3.zip(r-4.7-x86_64)specProc_0.8.3.zip(r-4.7-arm64)specProc_0.8.3.zip(r-4.6-x86_64)specProc_0.8.3.zip(r-4.6-arm64)
specProc_0.8.3.tar.gz(r-4.7-arm64)specProc_0.8.3.tar.gz(r-4.7-x86_64)specProc_0.8.3.tar.gz(r-4.6-arm64)specProc_0.8.3.tar.gz(r-4.6-x86_64)
specProc_0.8.3.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
specProc/json (API)

# Install 'specProc' in R:
install.packages('specProc', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/christiangoueguel/specproc/issues

Pkgdown/docs site:https://christiangoueguel.com

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

Conda:

cpp

3.30 score 6 scripts 149 exports 37 dependencies

Last updated from:4b6fcf045e. Checks:10 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK367
linux-devel-x86_64OK285
source / vignettesOK484
linux-release-arm64OK345
linux-release-x86_64OK381
windows-devel-arm64OK553
windows-devel-x86_64OK505
windows-release-arm64OK462
windows-release-x86_64OK328
wasm-releaseOK199

Exports:%>%adjusted_boxplotapply_calibrationaveragebaseline_alsbaseline_arplsbaseline_lambdabaseline_lspbiweight_locationbiweight_midcorrelationbiweight_midcovariancebiweight_midvariancebiweight_scaleboltzmannboltzmann_plotcalibration_curvecellpcacentercf_libscontributionscorrect_self_absorptioncorrelationdirect_orthogonaldirect_oscdirectional_outlyingnessdirectOutlyingnessdmodxelectron_densityemscepoflagged_regionsgaussian_profilegeneralized_boxplotglswglsw_alphahotelling_t2iqr_outliersiqrMethodlibs_linesline_finderline_intensitiesloading_peakslorentzianlorentzian_profilemacropcamcwhirter_criterionmedcouple_weightminmaxmscmultipeak_fitmultipeakfitnasnist_ionization_energynist_levelsnist_linesnormalizeo2plsoplsoscoutlierplotparetopareto_scalepartition_functionpdspeak_fitpeakfitplot_boltzmannplot_calibrationplot_cell_mapplot_contributionsplot_embeddingplot_fitplot_influenceplot_linesplot_loadingsplot_outlier_mapplot_outliersplot_somplot_spectraplot_wavelength_calibrationplotfitplotSpecpoisson_scaleprojected_oscpseudo_voigtpseudo_voigt_profileq_residualsquantile_weightread_starkbreject_shotsrobpcarobust_bcyjrobustBCYJrospcarousseeuw_crouxrousseeuwCrouxsaha_boltzmannsaha_boltzmann_plotsaturation_summarysavgol_derivativesavitzky_golayself_absorptionsnvsomsom_stabilityspectral_norm_methodstark_tablestark_widthstarkb_linesstep_baselinestep_cellpcastep_direct_orthogonalstep_direct_oscstep_emscstep_epostep_glswstep_line_intensitiesstep_line_ratiostep_macropcastep_mscstep_o2plsstep_oplsstep_oscstep_pareto_scalestep_poisson_scalestep_projected_oscstep_reject_shotsstep_robpcastep_robust_bcyjstep_rospcastep_savgolstep_snvstep_spectral_normstep_waveletstep_y_gradient_glswsummary_statssummaryStatstukey_ghtukeyGHumadvoigt_fwhmvoigt_profilewavelength_calibrationwavelet_featureswavelet_levelwhittakery_gradient_glswyGradientglswzscore

Dependencies:clicpp11DEoptimRdplyrfarvergenericsggplot2gluegtableisobandlabelinglifecyclemagrittrMASSminpack.lmmomentspillarpkgconfigplspurrrR6RColorBrewerRcppRcppEigenrlangrobustbaseS7scalesstringistringrtibbletidyrtidyselectutf8vctrsviridisLitewithr

Fitting emission lines
Identifying the lines | Correcting the wavelength axis | Line profiles | Fitting a single line | Overlapping lines | Fitting every spectrum | Integrating instead of fitting | Summary

Last update: 2026-10-15
Started: 2026-10-15

Preprocessing with recipe steps
Baseline correction | Normalization | Other steps | A model for potassium

Last update: 2026-10-15
Started: 2026-10-15

Calibration curves and figures of merit
Line intensities | A calibration curve for potassium | Trace elements: weights and limits of detection | A multivariate model and its figures of merit | Summary

Last update: 2026-10-15
Started: 2026-10-15

Plasma diagnostics
Detector saturation | Electron density | Temperature | Atomic data | Line intensities | Boltzmann and Saha-Boltzmann plots | Is the plasma in LTE? | Self-absorption | Calibration-free composition | Summary | References

Last update: 2026-10-15
Started: 2026-10-15

Readme and manuals

Help Manual

Help pageTopics
Adjusted Boxplotadjusted_boxplot
Apply a Wavelength Calibrationapply_calibration
Fast Average for Large Spectral Datasetaverage
Asymmetric Least Squaresbaseline_als
Asymmetrically Reweighted Penalized Least Squaresbaseline_arpls
Baseline Smoothness Parameterbaseline_lambda
Least-Squares Polynomialbaseline_lsp
Biweight Locationbiweight_location
Biweight Midcorrelationbiweight_midcorrelation
Biweight Midcovariancebiweight_midcovariance
Biweight Midvariancebiweight_midvariance
Biweight Scalebiweight_scale
Plasma Temperature from a Boltzmann Plotboltzmann
Univariate Calibration Curvecalibration_curve
Robust PCA by Casewise and Cellwise Weighting (cellPCA)cellpca
Data Centeringcenter
Calibration-Free LIBS Quantificationcf_libs
Q and T-squared Contributions of a PCA Modelcontributions
Self-Absorption Correction with an Internal Reference Linecorrect_self_absorption
Correlation Coefficients: Pearson, Spearman, Kendall, Chatterjee, and Biweight Midcorrelationcorrelation
Direct Orthogonalizationdirect_orthogonal
Direct Orthogonal Signal Correctiondirect_osc
Directional Outlyingness for Skewed Distributiondirectional_outlyingness
Distance to the Model (DModX) of a PCA Modeldmodx
Electron Density from Stark Broadeningelectron_density
Extended Multiplicative Signal Correctionemsc
External Parameter Orthogonalizationepo
Flagged Regions of a MacroPCA or cellPCA Fitflagged_regions
LIBS Spectra of Forage SamplesforageLIBS
Gaussian Functiongaussian_profile
Generalized Boxplotgeneralized_boxplot
Generalized Least Squares Weightingglsw
Relative GLSW Weighting Parameterglsw_alpha
Hotelling's T-squared Statistic of Samples in an Embeddinghotelling_t2
Interquartile Range Methodiqr_outliers
Candidate Emission Lines for LIBS Spectralibs_lines
Interactive Identification of Emission Linesline_finder
Intensities of Emission Linesline_intensities
Peaks of the Loadings of a PCAloading_peaks
Lorentzian Functionlorentzian_profile
Robust PCA for Cellwise and Casewise Outliers (MacroPCA)macropca
McWhirter Criterion for Local Thermodynamic Equilibriummcwhirter_criterion
Medcouple Tail Weight Measuremedcouple_weight
Min-Max Normalizationminmax
Multiplicative Signal Correctionmsc
Multiple Peaks Fittingmultipeak_fit
Net Analyte Signal and Figures of Meritnas
Ionization Energies from the NIST Atomic Spectra Databasenist_ionization_energy
Energy Levels and Partition Functions from the NIST Atomic Spectra Databasenist_levels partition_function
Atomic Line Data from the NIST Atomic Spectra Databasenist_lines
Spectra Normalizationnormalize
Modified Orthogonal Projections to Latent Structureso2pls
Orthogonal Projections to Latent Structuresopls
Orthogonal Signal Correctionosc
Pareto Scalingpareto_scale
Piecewise Direct Standardizationpds
Peak Fittingpeak_fit
Draw a Boltzmann or Saha-Boltzmann Plotplot_boltzmann
Plot a Calibration Curveplot_calibration
Cell Map of a MacroPCA or cellPCA Fitplot_cell_map
Plot Q and T-squared Contributionsplot_contributions
Plot a Two-Dimensional Embeddingplot_embedding
Plotting of Fitted Spectral Lineplot_fit
Influence Plot of a PCA Modelplot_influence
Overlay Emission Lines on a Spectrumplot_lines
Loadings of a PCA as Spectraplot_loadings
Outlier Map of a Robust PCAplot_outlier_map
Univariate Representation of Multivariate Outliersplot_outliers
Plot a Self-Organizing Mapplot_som
Plotting of Spectraplot_spectra
Plot a Wavelength Calibrationplot_wavelength_calibration
Poisson Scalingpoisson_scale
Predict from a Calibration Curvepredict.specproc_calibration
Apply EMSC to New Spectrapredict.specproc_emsc
Apply an Orthogonalization Filter to New Spectrapredict.o2pls predict.specproc_direct_orthogonal predict.specproc_direct_osc predict.specproc_epo predict.specproc_filter predict.specproc_osc predict.specproc_projected_osc
Scores and Distances of New Observationspredict.specproc_cellpca predict.specproc_macropca predict.specproc_robpca
Net Analyte Signal of New Samplespredict.specproc_nas
Predict with an OPLS Modelpredict.specproc_opls
Map New Spectra onto a Self-Organizing Mappredict.specproc_som
Correct Wavelengths with a Wavelength Calibrationpredict.specproc_wavelength_calibration
Projected Orthogonal Signal Correctionprojected_osc
Pseudo-Voigt Functionpseudo_voigt_profile
Hotelling's T-squared and Q Residuals of a PCA Modelq_residuals
Quantile Tail Weight Measurequantile_weight
Read Saved STARK-B Dataread_starkb
Rejection of Outlying Laser Shotsreject_shots
Robust Principal Component Analysis (ROBPCA)robpca
Robust Box-Cox and Yeo-Johnson Transformationrobust_bcyj
Robust Sparse Principal Component Analysis (ROSPCA)rospca
Rousseeuw-Croux Scale Estimatorsrousseeuw_croux
Plasma Temperature from a Saha-Boltzmann Plotsaha_boltzmann
Detect Saturated Channels in Spectrasaturation_summary
Derivative Order of a Savitzky-Golay Filtersavgol_derivative
Savitzky-Golay Smoothing and Derivativessavitzky_golay
Self-Absorption Coefficient from Line Widthsself_absorption
Standard Normal Variatesnv
Self-Organizing Map of Spectrasom
Stability of a Self-Organizing Mapsom_stability
Norm of a Spectral Normalizationspectral_norm_method
Build a Table of Stark Broadening Parametersstark_table
Stark Width of a Line at Given Plasma Conditionsstark_width
Stark Broadening Parameters from the STARK-B Databasestarkb_lines
Baseline Correction Recipe Stepstep_baseline
cellPCA Recipe Stepstep_cellpca
Direct Orthogonalization Recipe Stepstep_direct_orthogonal
Direct Orthogonal Signal Correction Recipe Stepstep_direct_osc
Extended Multiplicative Signal Correction Recipe Stepstep_emsc
External Parameter Orthogonalization Recipe Stepstep_epo
Generalized Least Squares Weighting Recipe Stepstep_glsw
Emission Line Intensities Recipe Stepstep_line_intensities
Internal Standard Normalization Recipe Stepstep_line_ratio
MacroPCA Recipe Stepstep_macropca
Multiplicative Scatter Correction Recipe Stepstep_msc
O2PLS Filter Recipe Step for One or Several Outcomesstep_o2pls
Orthogonal Projections to Latent Structures (OPLS) Recipe Stepstep_opls
Orthogonal Signal Correction Recipe Stepstep_osc
Pareto Scaling Recipe Stepstep_pareto_scale
Poisson Scaling Recipe Stepstep_poisson_scale
Projected Orthogonal Signal Correction (OPLS Filter) Recipe Stepstep_projected_osc
Shot Rejection Recipe Stepstep_reject_shots
Robust PCA (ROBPCA) Recipe Stepstep_robpca
Robust Box-Cox and Yeo-Johnson Transformation Recipe Stepstep_robust_bcyj
Robust Sparse PCA (ROSPCA) Recipe Stepstep_rospca
Savitzky-Golay Recipe Stepstep_savgol
Standard Normal Variate Recipe Stepstep_snv
Spectral Normalization Recipe Stepstep_spectral_norm
Wavelet Features Recipe Stepstep_wavelet
y-Gradient Generalized Least Squares Weighting Recipe Stepstep_y_gradient_glsw
Classical or Robust Descriptive Statisticssummary_stats
Tukey g-and-h Parametric Distributiontukey_gh
Unbiased Median Absolute Deviationumad
Full Width at Half Maximum of a Voigt Profilevoigt_fwhm
Voigt Functionvoigt_profile
Wavelength Calibration from Reference Lineswavelength_calibration
Wavelet Coefficients of Spectrawavelet_features
Number of Levels of a Wavelet Decompositionwavelet_level
y-Gradient Generalized Least Squares Weightingy_gradient_glsw
Classical or Robust Z-Scorezscore