readSpectra: Function to read spectra.

Description Usage Arguments Value Author(s) References Examples

View source: R/readSpectra.R

Description

This function accepts a vector of file paths specifying files that contain spectra. The function incorporates these spectra into a single spectra.matrix object. The function supports .dpt, .txt, opus binary (e.g., .0), and .spc files. Files import for .spc files is done using the package hpyerSpec and import of opus format is done using the package soil.spec. These formats are auto detected. Feel free to request/suggest file formats.

Usage

1
2
readSpectra(filelist, wave_unit = "wavenumber",
  measurement_unit = NULL, ...)

Arguments

filelist

A vector (e.g., the output of list.files(full.names = TRUE)) containing the file paths for spectra to read.

wave_unit

"wavenumber" or "wavelength".

measurement_unit

"absorbance" or "transmittance" or "reflectance".

...

additional agruments.

Value

Returns an object of class spectra.matrix.

Author(s)

Daniel M Griffith

References

Claudia Beleites and Valter Sergo: hyperSpec: a package to handle hyperspectral data sets in R', R package version 0.99-20171005. http://hyperspec.r-forge.r-project.org Andrew Sila, Tomislav Hengl and Thomas Terhoeven-Urselmans (2014). soil.spec: Soil Spectroscopy Tools and Reference Models. R package version 2.1.4. https://CRAN.R-project.org/package=soil.spec

Examples

1
2
3
4
5
## Not run: 
# MY_PATH = is a text string identifying the folder with the spectra 
specs <- readSpectra(filelist = list.files("MY_PATH", full.names = T))

## End(Not run)

griffithdan/plantspec documentation built on Dec. 9, 2018, 1:26 a.m.