spectralAnalysis (version 3.12.0)

normalize: generic normalization function

Description

generic normalization function

Usage

normalize(object, ...)

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

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 wavelength * integrate scale by integrating over wavelengthRange

wavelengthRange

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

wavelength

reference wavelength 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
# NOT RUN {
 spectralEx            <-  getSpectraInTimeExample()
 timeRange                        <-  range( getTimePoints( spectralEx ))
 timesToSelect                    <-  e(  seq( timeRange[1] , timeRange[2] , length.out = 5  )   )
 
# }
# NOT RUN {
 plot( spectralEx )
 plot( spectralEx[ timesToSelect ,  ] , type = "time" )
# }
# NOT RUN {
 normalizePeak         <-  normalize( spectralEx , method = "peak" , wavelength = 400 )
 getPreprocessing( normalizePeak )
# }
# NOT RUN {
 plot( normalizePeak[ timesToSelect ,  ] , type = "time" )
 plot( normalizePeak )
# }
# NOT RUN {
 normalizeIntegration  <-  normalize( spectralEx , method = "integration" )
# }
# NOT RUN {
 plot( normalizeIntegration[ timesToSelect ,  ] , type = "time" )
# }
# NOT RUN {
 normalizedUser  <-  normalize( spectralEx , method = "normalize" , mean = "median" , scale = "sd" )
# }
# NOT RUN {
 plot( normalizedUser[ timesToSelect ,  ] , type = "time" ) 
# }

Run the code above in your browser using DataLab