[!v0.1] Read spectroscopic CSV (comma separated values) file

read.sp.csv2(
  file,
  parse_filename = NULL,
  ylab = "Absorbance",
  xlab = "Wavelength, nm",
  ...
)

Arguments

file

The name of the file with specroscopic data.

parse_filename

(function | string | NULL) Either a function that parses string of filename and extracts relevant information,
or a regular expression to be used to parse file name and extract relevant information,
or NULL.

ylab

(string) Label for y (intensity) axis. Defaut is "I, a.u.".

xlab

(string | NULL) Label for x (wavelength) axis. If NULL (defaut) - the label is selected automatically.

...

parameters to be passed to read.csv.

Value

A hyperSpec object with technical and spectroscopic information from file file.

Details

In read.sp.csv the default decimal symbol is dot (.).
In read.sp.csv2 - comma (,).

Author

Vilmantas Gegzna

Examples


# \donttest{
if (FALSE) {

read.sp.csv2("Spectra_ascii.txt")

# Read several files to one `hyperspec` object:

Files   <- dir()[1:4]                           # 4 files are selected
sp_list <- lapply(Files, read.sp.csv)  # Make a list of objects
sp      <- collapse(sp_list)                    # Merge several spectra to one object

plotmat(sp)
}# }