read_spec: Read spectral data

read_textR Documentation

Read spectral data

Description

Functions for reading spectral data types including .asp, .jdx, .spc, .spa, .0, and .csv.

Usage

read_text(
  file = ".",
  cols = NULL,
  method = "read.csv",
  share = NULL,
  id = paste(digest(Sys.info()), digest(sessionInfo()), sep = "/"),
  ...
)

read_asp(
  file = ".",
  share = NULL,
  id = paste(digest(Sys.info()), digest(sessionInfo()), sep = "/"),
  ...
)

read_spa(
  file = ".",
  share = NULL,
  id = paste(digest(Sys.info()), digest(sessionInfo()), sep = "/"),
  ...
)

read_jdx(
  file = ".",
  share = NULL,
  id = paste(digest(Sys.info()), digest(sessionInfo()), sep = "/"),
  ...
)

read_spc(
  file = ".",
  share = NULL,
  id = paste(digest(Sys.info()), digest(sessionInfo()), sep = "/"),
  ...
)

read_0(
  file = ".",
  share = NULL,
  id = paste(digest(Sys.info()), digest(sessionInfo()), sep = "/"),
  ...
)

read_extdata(file = NULL)

Arguments

file

file to be read from.

cols

character vector of length = 2 indicating the colum names for the wavenumber and intensity; if NULL columns are guessed.

method

submethod to be used for reading text files; defaults to read.csv but fread works as well.

share

defaults to NULL; needed to share spectra with the Open Specy community; see share_spec() for details.

id

a unique user and/or session ID; defaults to paste(digest(Sys.info()), digest(sessionInfo()), sep = "/").

...

further arguments passed to the submethods.

Details

read_spc() and read_jdx() are just a wrapper around the functions provided by the hyperSpec package. Other functions have been adapted various online sources. All functions convert datasets to a 2 column table with one column labeled "wavenumber" and the other "intensity". There are many unique iterations of spectral file formats so there may be bugs in the file conversion. Please contact us if you identify any.

Value

All read_*() functions return data frames containing two columns named "wavenumber" and "intensity".

Author(s)

Zacharias Steinmetz, Win Cowger

See Also

read.jdx(); read.spc(); readRaw(); share_spec()

Examples

read_text(read_extdata("raman_hdpe.csv"))
read_asp(read_extdata("ftir_ldpe_soil.asp"))
read_0(read_extdata("ftir_ps.0"))


OpenSpecy documentation built on July 6, 2022, 5:07 p.m.