Loading a CSV file (e.g. comma or tab. separated) into R is straightforward. We can load the reference data and the PHAZIR data as follows:
The reference data are composed of 7 columns containing the parameters measured in the laboratory for each sample:
Step = Sample drying step number
SpeciesID = wood (tree) species identification (A for Aspen and P for Poplar)
sampleID (self explanatory)
MC = Moisture content of each sample
ASDref = Reference number for spectra acquired with the ASD
PHAZIRref = Reference number for spectra acquired with the PHAZIR
The first column of the PHAZIR data frame contains the reference numbers of the spectra acquired with the PHAZIR. The rest of the data frame is the spectral matrix. Each row represents a spectrum and each column represents a wavelength (from 939.5 nm to 1796.6 nm by increment of ~ 9 nm). The values represent the absorbance (measured as log(1/R)) of the NIR “light” at each wavelength.
The reference data can be matched with the PHAZIR spectra based on spectra reference numbers (column “PHAZIRref” common to the two data sets). One way to do this: