Skip to contents

Coerce

Usage

# S3 method for GammaSpectrum
as.matrix(x, ...)

Arguments

x

An object to be coerced.

...

Currently not used.

Value

A coerced object.

Author

N. Frerebeau

Examples

## Import a Canberra CNF file
spc_file <- system.file("extdata/LaBr.CNF", package = "gamma")
spc <- read(spc_file)

## Coerce
mtx <- as.matrix(spc)
df <- as.data.frame(spc)
head(df)
#>   channel    energy count rate
#> 1       1 -7.004032     0    0
#> 2       2 -4.007936     0    0
#> 3       3 -1.011712     0    0
#> 4       4  1.984640     0    0
#> 5       5  4.981120     0    0
#> 6       6  7.977728     0    0