Learn R Programming

MALDIquant (version 1.0)

intensityMatrix: Converts a list MassObject objects into a matrix.

Description

This function converts a list of AbstractMassObject objects into a matrix.

Usage

intensityMatrix(l, replaceNaBy=0)

Arguments

l
list of AbstractMassObject objects.
replaceNaBy
replaces all missing data (NA) by replaceNaBy given value. To preserve all NA choose replaceNaBy=NULL.

Value

  • Returns a matrix containing intensities of all AbstractMassObject objects of l. The matrix has length(l) rows (one row for each sample) and length(unique(mass)) columns.

Details

The column names of the returned matrix store the mass values.

References

See website: http://strimmerlab.org/software/maldiquant/

See Also

AbstractMassObject,

Examples

Run this code
## load library
library("MALDIquant");

## create example MassPeaks objects
p <- list(createMassPeaks(mass=1:4,
                          intensity=11:14,
                          metaData=list(name="test mass peaks 1")),
          createMassPeaks(mass=2:5,
                          intensity=22:25,
                          metaData=list(name="test mass peaks 2")));

## converts MassPeaks objects into a matrix 
intensityMatrix(p);

## converts MassPeaks objects into a matrix (preserve NAs)
intensityMatrix(p, replaceNaBy=NULL);

Run the code above in your browser using DataLab