scale {tofsims} | R Documentation

## generic for scale

### Description

generic for scale

scale autoscaling method for MassSpectra object. Scaling is along the mass channels. Therefore more than one spectra is needed for scaling.

### Usage

    scale(x, center = TRUE, scale = TRUE)

    ## S4 method for signature 'MassSpectra'
    scale(x, center = TRUE, scale = TRUE)

### Arguments

`x` | object object of class MassSpectra
`center` | boolean should data be centered
`scale` | boolean should data be scaled

### Value

object of class MassSpectra with scaled mass spectra

object of class MassSpectra

### Examples

    ## autoscaling of dummy image data
    testImage<-MassImage('dummy')
    par(mfcol=c(2,2))
    plot(testImage,type='l')
    image(testImage)
    testImage <- scale(testImage)
    plot(testImage,type='l')
    image(testImage)
    ## Not run:
    ## autoscaling of real spectral data
    library(tofsimsData)
    data(tofsimsData)
    par(mfcol=c(2,2))
    plot(testImage,type='l')
    image(testImage)
    testImage <- scale(testImage)
    plot(testImage,type='l')
    image(testImage)
    ## End(Not run)

[Package tofsims version 1.16.0 Index]