Using R for infrared spectroscopy research


Collecting and analysing large number of samples may often be expensive, although necessary for several studies. Infrared spectroscopy is a high-throughput, non-destructive, and cheap sensing method that has a large range of applications in agricultural, plant and environmental sciences.  The inherent complexity of Infrared data makes necessary the use of advanced statistical tools to extract relevant information from a sample of a given material (e.g. soil).

This half-day workshop intends to present a tutorial on multivariate analysis using the R statistical Software, with focus on chemometric methods for:

  • Pre-processing and outlier detection
  • Measuring the similarity/dissimilarity between spectra
  • Calibration sampling (what and how many samples to choose to build accurate multivariate models)
  • Multivariate calibration (global models, local models for large and complex datasets)
  • Transferring NIR data across different instruments

During the course, we will show how to efficiently integrate different R tools for advanced soil spectroscopy research. We will provide the attendees with several R code examples as well as soil datasets. Important links:





  • 09:15– 09:30 Introduction 
  • 09:30–10:45 Pre-processing and sampling spectral information (with computer practical)
  • 10:45–11:00 Coffee break
  • 11:00–12:30 Multivariate calibration (with computer practical)
  • 12:30–13:30 Lunch


All participants must bring their own laptops with R > 3.3.1 and R Studio Desktop > 0.99.903 installed. The computer practicals are done in the R language. Prior experience with R is not a prerequisite but at least some experience is recommended. 


Leonardo Ramirez-Lopez – NIR Data Analytics, BUCHI Labortechnik. Switzerland.


Leonardo holds a PhD in Soil Science and 10 years of experience on infrared spectroscopy. He has worked at several research groups, in Brazil (University of São Paulo), Germany (University of Tübingen), Belgium (Université catholique de Louvain) and Switzerland (ETH Zurich). He currently works as NIR Data Analytics Manager at BUCHI Labortechnik AG.  He has developed two (publicly available) R packages for the analysis of soil infrared spectral data: prospectr and resemble. The first one includes functions for spectral pre-processing and calibration sampling, while the second one includes functions for modeling complex spectral data.


Alexandre Wadoux – Soil Geography and Landscape group, Wageningen University, Netherlands


Alexandre is PhD candidate at Wageningen University. He completed a M.Sc. in Physical Geography at the University of Tübingen (Germany) where he conducted research on soil spectroscopy and soil-landscape analysis. His work focuses on statistical analysis of environmental variables and sampling design optimization mostly using the R software. He is part since 2015 of the EU funded FP7 Marie Curie Initial Training Network (ITN) ‘Quantifying Uncertainty in Integrated Catchment Studies (QUICS)’.