normalize: generic normalization function

normalizeR Documentation

generic normalization function

Description

generic normalization function

Usage

normalize(object, ...)

## S4 method for signature 'SpectraInTime'
normalize(
  object,
  method = "normalize",
  spectralRange = r(-Inf, Inf),
  spectralAxisVal = NULL,
  scaleFunction = "sd",
  meanFunction = NULL
)

## S4 method for signature 'SpectraInTimeComp'
normalize(object, ...)

Arguments

object

a S4 class object

...

additional parameters

method

a method for normalization or peak correction , choose from:

* normalize substract mean and divide by scale * peak scale by reference spectralAxisVal * integration scale by integrating over spectralAxisRange

spectralRange

range for integration if method = integration , defaults to complete range

spectralAxisVal

reference spectral axis value (wavelength or other) for peak regresssion

scaleFunction

scale function used when method = normalize defaults to sd

meanFunction

mean function used when method = normalize defaults to mean

Value

SpectraInTime-class

Examples

 spectralEx            <-  getSpectraInTimeExample()
 timeRange             <-  range( getTimePoints( spectralEx ))
 timesToSelect         <-  e(  seq( timeRange[1] , timeRange[2] , length.out = 5  )   )
 
 plot( spectralEx )
 plot( spectralEx[ timesToSelect ,  ] , type = "time" )

 normalizePeak         <-  normalize( spectralEx , method = "peak" , spectralAxisVal = 400 )
 getPreprocessing( normalizePeak )

 plot( normalizePeak[ timesToSelect ,  ] , type = "time" )
 plot( normalizePeak )

 normalizeIntegration  <-  normalize( spectralEx , method = "integration" )

 plot( normalizeIntegration[ timesToSelect ,  ] , type = "time" )

 normalizedUser  <-  normalize( spectralEx , method = "normalize" , mean = "median" , scale = "sd" )

 plot( normalizedUser[ timesToSelect ,  ] , type = "time" ) 


spectralAnalysis documentation built on Jan. 11, 2023, 5:15 p.m.