read_Spectrum: Read in single or multiple ESR spectra

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/read_Spectrum.R

Description

Use this function to import a series of associated ESR spectra into R.

Usage

1

Arguments

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:

  • "auto" (the default)

  • "ESP300-E" (.SPC)

  • "ELEXSYS500" (.DTA)

  • "EMXplus" (.SPC)

...

further arguments (e.g., n to specify the number of datapoints; sw to specify the sweep width).

Details

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:

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'.

Value

Returns a terminal output. In addition an R6Class object is returned.

Author(s)

Christoph Burow, University of Cologne (Germany)

References

In progress

See Also

read.table, readBin, read.csv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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)

tzerk/ESR documentation built on May 20, 2019, 1:12 p.m.