Learn R Programming

gamma (version 1.1.0)

read: Data Input

Description

Reads a gamma ray spectrum file.

Usage

read(file, ...)

# S4 method for character read(file, extensions = c("cnf", "tka", "spe"), ...)

Value

A GammaSpectra object if more than one spectrum are imported at once, else a GammaSpectrum object.

Arguments

file

A character string giving the path of files to be imported.

...

Extra parameters to be passed to rxylib::read_xyData().

extensions

A character vector specifying the possible file extensions. It must be one or more of "cnf", "tka", "spe".

Author

N. Frerebeau

See Also

rxylib::read_xyData()

Other IO: summarise()

Examples

Run this code
## Import a Canberra CNF file
cnf_file <- system.file("extdata/LaBr.CNF", package = "gamma")
(cnf_spc <- read(cnf_file))

## Import a TKA file
tka_file <- system.file("extdata/LaBr.TKA", package = "gamma")
(tka_spc <- read(tka_file))

## Import all files in a given directory
spc_dir <- system.file("extdata/BDX_LaBr_1/calibration", package = "gamma")
(spc <- read(spc_dir))

Run the code above in your browser using DataLab