Skip to contents

Read .Rda files as saved during data acquisition and build a collection with the spectra read, possibly first trimming the range of wavelengths and/or smoothing the spectral data.

Usage

collect_spct_files(
  path = ".",
  range = NULL,
  method = NULL,
  strength = 0,
  name.root = "",
  na.rm = FALSE
)

Arguments

path

a character string giving the name of the folder from wich to load .Rda files containing spectra.

range

a numeric vector of length two, or any other object for which function range() will return two.

method

a character vector of length 1 or 2, containing the smoothing method to use, one of "custom", "lowess", or "supsmu".

strength

numeric value to adjust the degree of smoothing.

name.root

character string to prepend to the name of the spectra in the collection.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Note

If the argument passed to method is of length 2, the first member will apply to source_spct objects and the second one to filter_spct and reflector_spct objects. A numeric vector of length 2 passed to strength is treated in the same way. This is only relevant when we are collecting spectra belonging to different classes and need to treat them differently with respect to smoohting. It also allows different defaults, as transmittance spectra tend to lack the fine structure of some emission spectra.

See also

Function trim_wl is used to trim the range of the data to plot, and function smooth_spct is used for smoothing, and prameters range, and strength and method are passed to them, respectively.

Other functions for importing spectral data from files: map_oofile_header_rows(), oofile_data_rows(), plot_spct_file(), read_files2mspct(), read_oo_data(), read_oo_ovdata(), read_oo_pidata(), read_oo_ssdata(), set_oo_ssdata_descriptor(), set_oo_ssdata_settings()