read.txt.OceanOptics: Parse Ocean Optics SpectraSuite "text with header"

Description Usage Arguments Details Value Examples

Description

Given the path to a folder of Ocean Optics SpectraSuite "text with header" files, ending in '*.txt', this function will parse all files returning a hyperSpec object that includes the spectra and metadata

Usage

1
read.txt.OceanOptics(files = "*.txt", label = list(spc = "DN (counts)"))

Arguments

files

A specific file path or list of file paths. Default is select all text files in working directory '*.txt'

label

A list of form list(parameter=expression(parameter)). Default is to label the parameter as "DN (counts)"

Details

At present only "text with header" format is supported, however further formats maybe added.

Value

A hyperSpec object including a matrix of spectra, metadata extracted from the spectra headers and file information

Examples

1
2
3
4
5
6
# set path to data files
file.path <- system.file("extdata", package = "FASTSpectra")

# parse spectra into hyperSpec object
dn <- read.txt.OceanOptics(files=paste0(file.path,"/*.txt"))
summary(dn)

edwardpmorris/FASTSpectra documentation built on May 15, 2019, 11:03 p.m.