read: Data Input

readR Documentation

Data Input

Description

Reads a gamma ray spectrum file.

Usage

read(file, ...)

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

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

Value

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

Note

Only supports Canberra CNF and TKA files.

Author(s)

N. Frerebeau

See Also

rxylib::read_xyData()

Other IO: summarise()

Examples

## 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))

nfrerebeau/gamma documentation built on April 14, 2024, 7:26 a.m.