spectralAnalysis (version 3.12.0)

SpectraInTime-class: SpectraInTime-class (time resolved spectra ) wavelength-time data for 1 experiment

Description

SpectraInTime-class (time resolved spectra ) wavelength-time data for 1 experiment

extract summary specs from SpectraInTime-class by wavelengths over time

convert to data.frame (used in visualization)

Plotting methods for 'spectralAnalysis'

Usage

# S4 method for SpectraInTime
dim(x)

extractSummarySpecs(object, summaryFunctions = getDefaultSumFunc())

# S4 method for SpectraInTime summary(object, summaryFunctions = getDefaultSumFunc())

# S4 method for SummaryByWavelengths show(object)

# S4 method for SpectraInTime as.data.frame(x, timePointsAlt = FALSE, timeUnit = "seconds")

# S4 method for SpectraInTime,missing plot(x, y, type = "3D", timeUnit = "hours", timePointsAlt = FALSE, colors = "D")

# S3 method for list plot(x, ...)

Arguments

x

the object to be plotted

object
summaryFunctions

a character vector of summary functions

timePointsAlt
timeUnit
y

not used, for consitency with plot method

type

character choice of plot type between: * 3D surface plot (default) * wavelenth wavelength in legend, time on the axis * time time in legend, wavelength on the axis

colors

colorblind friendly palettes are used from the de viridis_pal choice between code"A" (magna), code"B" (inferno), "C" (plasma) and "D" the default viridis color palette

...

additional argument, for plotting a list of spectra one can use:

  • times numeric vector of time points to plot

  • timeUnit time unit for times default to "seconds"

  • timePointsAlt logical value indicating whether alternative time axis should be used, defaults to FALSE

object

SpectraInTime-class

summaryFunctions

character vector of summary functions

Value

data.frame with first column wavelengths followed

a data.frame containing spectral information in long format

Slots

spectra

matrix of spectral measurement with as rows timePoints and columns wavelengths

experimentName

character vector with name of the experiment

wavelengths

numeric vector of wavelengths

timePoints

of measurement in seconds

timePointsAlt

numeric vector of shifted time points in order to time align multiple spectral measurements in plots, by default equal to timePoints

extraInfo

list additional information such as probe type

startTime

start date and time POSIXct format

units

list with information on measurement units

preprocessing

list of preprocessing steps in taken in order

Examples

Run this code
# NOT RUN {
  spectralExample   <-  getSpectraInTimeExample()
  mimMaxSpec        <-  spectralAnalysis:::extractSummarySpecs( spectralExample ,
 c( "min" , "max" ) )

 spectralExample  <-  getSpectraInTimeExample() 
 summarySpectra   <-  summary( spectralExample )
 str( summarySpectra )
 summarySpectra

## convert to data.frame
spectra                 <-  getSpectraInTimeExample()
spectraFlat             <-  as.data.frame( spectra )


### visualization 
  
# }
# NOT RUN {
  data = getSpectraInTimeExample()
  plot( x =  data , type = "3D" , timeUnit = "hours" , timePointsAlt = FALSE )
  plot( x =  data[  , r(500, 350) ] , type = "3D" ,
      timeUnit = "hours" , timePointsAlt = TRUE , colors = "B"  )
  plot( x =  data[ e( 1 , 2 , 3) , , timeUnit = "hours" ] ,
      type = "time" , timeUnit = "hours" , timePointsAlt = FALSE ) 
  plot( x =  data[ , e( seq( 200 , 400 , 50 ) ) ] , 
     type = "wavelength" , timeUnit = "minutes" , timePointsAlt = TRUE , colors = "A" )
# }
# NOT RUN {
  
 ## plotting a list of spectra
    
 listOfSpectra     <-  getListOfSpectraExample()
 plot( listOfSpectra , times = 1 , timeUnit = "hours" )
 plot( listOfSpectra , times = 1 , timeUnit = "hours" , timePointsAlt = TRUE  )
 plot( listOfSpectra , times = 1:3 , timeUnit = "hours" , colors = "B" ) 
# }

Run the code above in your browser using DataLab