% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/load-spectra-yamsys.R
\name{read_spectra}
\alias{read_spectra}
\title{Read an OPUS text file and extract metadata}
\usage{
read_spectra(path)
}
\arguments{
\item{path}{character of the directory
where the spectral text files are stored}
}
\value{
List that contains the following elements:
\itemize{
 \item \code{MIR}: data.frame that contains all the spectra.
 The columns of \code{MIR} contain absorbance values at
 different wavenumber in the MIR range. The wavenumbers
 rounded to 0.1 are given as column names. The original file
 names are stored as row names. One line in the data frame
 \code{MIR} contains one replicate scan of a sample.
 \item \code{data_rep}: data.frame that constists of sample
 metadata that was extracted from the file name of
 individual spectral files. The first vector \code{ID}
 contains the spectral file name without the repetition number
 supplied as \code{.<number>} in the file name.
 Letters 1 to 2 of the spectral
 file name are used for the country abbreviation, stored
 as in the \code{} vector \code{data_rep} . Letters
 4 to 5 of the file name are used for the landscape (site)
 abbreviation.
}
}
\description{
Read single text file acquired with
an Bruker Vertex FTIR Instrument
(as exported from OPUS software) and extract sample metadata
provided in the filename
}
\note{
: This function is derived from  a re-factored and
simplified version of the \code{read.opus} function from the
\sQuote{soil.spec} package for reading OPUS VERTEX files
The function should also work for other OPUS files (eg alpha),
see \code{read.opus}. The function readOPUS() was
written by Antoine Stevens.
}

