spectralAnalysis (version 4.3.3)

normalize: generic normalization function

Description

generic normalization function

Usage

normalize(object, ...)

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

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

Value

SpectraInTime-class

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

Examples

Run this code
 spectralEx            <-  getSpectraInTimeExample()
 timeRange             <-  range( getTimePoints( spectralEx ))
 timesToSelect         <-  e(  seq( timeRange[1] , timeRange[2] , length.out = 5  )   )
 # \donttest{
 plot( spectralEx )
 plot( spectralEx[ timesToSelect ,  ] , type = "time" )
# }
 normalizePeak         <-  normalize( spectralEx , method = "peak" , spectralAxisVal = 400 )
 getPreprocessing( normalizePeak )
# \donttest{
 plot( normalizePeak[ timesToSelect ,  ] , type = "time" )
 plot( normalizePeak )
# }
 normalizeIntegration  <-  normalize( spectralEx , method = "integration" )
# \donttest{
 plot( normalizeIntegration[ timesToSelect ,  ] , type = "time" )
# }
 normalizedUser  <-  normalize( spectralEx , method = "normalize" , mean = "median" , scale = "sd" )
# \donttest{
 plot( normalizedUser[ timesToSelect ,  ] , type = "time" ) 
# }

Run the code above in your browser using DataLab