average.spec: average replicate spectra within a directory of spectra files

View source: R/average.spec.R

average.specR Documentation

average replicate spectra within a directory of spectra files

Description

Function to average replicate spectra within a directory of spectra files

Usage

average.spec(
  file.dir = NULL,
  out.dir = NULL,
  spec.type = "Reflectance",
  start.wave = NULL,
  end.wave = NULL,
  step.size = NULL,
  bias.threshold = NULL,
  outlier.cutoff = 2,
  suffix.length = NULL,
  output.file.ext = NULL,
  metadata.file = NULL,
  image = FALSE,
  settings.file = NULL
)

Arguments

file.dir

Directory of spectra files to process

out.dir

Output directory for processed spectra files

spec.type

Option to set what type of spectra to average. Options: Reflectance, Transmittance. Can be set with abbreviations: e.g. "Refl" or "Tran" Default is "Reflectance"

start.wave

Starting wavelength of spectra files. Not needed if specified in XML settings file.

end.wave

Ending wavelength of spectra files. Not needed if specified in XML settings file.

step.size

Resolution of spectra files. E.g. 1 for 1nm, 5 for 5nm. Not needed if specified in XML settings file.

bias.threshold

Reflectance/transmittance cutoff to remove spectra with anartificial bias (shift) due to improper spectral collection

outlier.cutoff

[Optional] Set upper/lower standard deviation cutoff to identify statistical Refl/Trans outliers within individual sample sets. Set as outlier.cutoff*Sample Sdev, e.g. 2.0*Sdev. Default 2.0

suffix.length

Length of auto numbering attached to ASD file names. This number of characters will be removed from the filename when averaged.

output.file.ext

Optional setting to set file extension of output files. Defaults to .csv

metadata.file

Option to select custom metadata file for use in processing. If not set then the information is either read from default metadata file, the settings file or at the function call. Need to set this as the full qualified path to the spectral metadata file is using a custom file/location

image

Logical. Whether to produce .png images of each spectrum (TRUE) or not (FALSE). Default is FALSE. Useful for diagnosing spectral observations during processing.

settings.file

Settings file used for spectral processing options (OPTIONAL). Contains information related to the spectra collection instrument, output directories, and processing options such as applying a jump correction to the spectra files. Options in the settings file take precedent over options selected in the function call.

spec.dataframe

Option to return a data frame with the converted spectra files

Author(s)

Shawn P. Serbin

Examples

## Not run: 
average.spec()
average.spec(file.dir,out.dir, start.wave=350,end.wave=2500,step.size=1,bias.threshold=0.06,
suffix.length=5,output.file.ext=".csv",spec.dataframe = TRUE,)

## End(Not run)
 

serbinsh/R-FieldSpectra documentation built on March 31, 2022, 10:08 p.m.