Ops.spectra: Arithmetic operators for spectra

View source: R/math_operator_overloads.R

Ops.spectraR Documentation

Arithmetic operators for spectra

Description

Overloads arithmetic operators for spectra using 'Ops.'

Usage

## S3 method for class '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

Author(s)

Jose Eduardo Meireles

Examples

library(spectrolab)
spec  = as_spectra(spec_matrix_example, name_idx = 1)
spec1 = spec * 2
spec2 = spec + spec
all(spec1 == spec2)

annakat/spectrolab documentation built on Oct. 14, 2023, 1:16 a.m.