Use this function to import a series of associated ESR spectra into R.
read_Spectrum(file, device = "auto", ...)
file | character (required): file path or directory where the spectra files are stored. |
---|---|
device | character (with default): Manually specify the device the spectrum files were produced by. By default, the proper binary format is deduced from the file extension, which may however fail in case of ambiguous file endings. See details. Allowed options are:
|
... | further arguments
(e.g., |
Returns a terminal output. In addition an
R6Class
object is returned.
This is a wrapper function for read.table
and readBin
.
The function should be
used to read in a series of associated ESR spectrum files. A list with all
spectrum data is returned, which can be passed to plot_Spectrum
for plotting the spectra.
Binary formats
This function is able to read in binary spectrum files produced by Bruker
ESR devices. By default (device = 'auto'
), the function assumes the
proper mode of the vector (integer or numeric), endianness and number of
bytes per element based on the file extension. Currently, the following
devices are supported:
Bruker ESP300-E (.SPC files): what = 'int', endian = 'big', size = 4
Bruker ELEXSYS500 (.DTA files): what = 'numeric', endian = 'big', size = 8
Bruker EMXplus (old) (.SPC files): what = 'numeric', endian = 'little', size = 4
Note that the Bruker ESP300-E and EMXplus devices share a common file
extension (.SPC) and that device = 'auto'
(the default) will always
assume that the SPC file is from a ESP300-E. If your SPC file is
from a EMXplus, however, you should manually specify this using
device = 'EMXplus'
.
In progress
# Import ASCII text file file1 <- system.file("extdata", "coral.txt", package = "ESR") spec1 <- read_Spectrum(file1)#> #># Import .zip archive file2 <- system.file("extdata", "mollusc.zip", package = "ESR") spec2 <- read_Spectrum(file2)#># Import Bruker ESP300-E raw binary spectrum file3 <- system.file("extdata", "mollusc.SPC", package = "ESR") spec3 <- read_Spectrum(file3)#> #># Import Bruker ELEXSYS500 spectrum (ASCII) file4 <- system.file("extdata", "dpph.ASC", package = "ESR") spec4 <- read_Spectrum(file4)#> #># Import Bruker ELEXSYS500 raw binary spectrum file5 <- system.file("extdata", "quartz.DTA", package = "ESR") spec5 <- read_Spectrum(file5)#> #># Import Bruker EMXplus raw binary spectrum file6 <- system.file("extdata", "DL_alanine.spc", package = "ESR") spec6 <- read_Spectrum(file6, device = "EMXplus")#> #># Import all example data sets at once by providing only the directory dir <- system.file("extdata", package = "ESR") specs <- read_Spectrum(dir)#>#>#> #>