transfIntensity {MALDIrppa} | R Documentation |
Transform intensity of MassSpectrum
objects
Description
This function applies user-defined transformations on the intensities of MassSpectrum
objects.
Usage
transfIntensity(x, fun = NULL, ...)
Arguments
x |
A list of |
fun |
Name of an user-defined transformation function or any other pre-defined one in R. |
... |
Other arguments. |
Details
This function allows the user to define any sensible function to be applied on signal intensities. For logarithm and square root transformations it is equivalent to transformIntensity
in the MALDIquant package.
Value
A list of MassSpectrum
objects with signal intensities transformed according to fun
.
Examples
# Load example data
data(spectra) # list of MassSpectra class objects
# Scale intensities into [0, 1] by dividing by their maximum value
scale.max <- function(x){x/max(x)} # define scaling function
scaled.spectra <- transfIntensity(spectra, fun = scale.max)
# Compute natural logarithm of intensity values (using the pre-defined sqrt R function)
log.spectra <- transfIntensity(spectra, sqrt)
[Package MALDIrppa version 1.1.0-2 Index]