Learn R Programming

spectrolab (version 0.0.12)

Ops.spectra: Arithmetic operators for spectra

Description

Overloads arithmetic operators for spectra using `Ops.`

Usage

# S3 method for spectra
Ops(e1, e2)

Arguments

e1

lhs

e2

rhs

Value

Depends on the operator. math operators will return spectra and logical or comparison operators will return boolean matrices

Examples

Run this code
# NOT RUN {
library(spectrolab)
spec  = as_spectra(spec_matrix_example, name_idx = 1)
spec1 = spec * 2
spec2 = spec + spec
all(spec1 == spec2)
# }

Run the code above in your browser using DataLab