assign.type: Assign spectra type using a logfile

Description Usage Arguments Details Value Examples

Description

Given a log file with columns sample identification, path to reference and sample measurements [id, R, S] this function creates a logical vector [is.REF] with the hyperSpec

Usage

1
assign.type(dn, logfile = "fieldlog.csv")

Arguments

dn

A hyperSpec object

logfile

Path to the corresponding logfile for the object

Details

The format of the logfile must be followed (.CSV). FIXME make more flexible

Value

A hyperSpec object including with sample identification [id] and indication if a reference measurement [is.REF]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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"))

# assign measurement id and type using fieldlog file
logfile <- paste0(file.path,"/fieldlog.csv")
dn <- assign.type(dn, logfile=logfile)

# split into sample and reference
type <- slot(dn,"data")[["type"]]
dn <- split(x=dn, f=type)
summary(dn)

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