View source: R/utility-functions.R
| expandMzIntensity | R Documentation |
expandMzIntensity() expands a data.frame with m/z and/or intensity
values stored as a list in columns "mz" and "intensity". The resulting
data.frame has the m/z and intensity values stored as numeric in columns
"mz" and "intensity", one value per row, with the content of other
columns repeated as many times as there are m/z and intensity values.
expandMzIntensity(x)
x |
|
data.frame with "mz" and "intensity" columns expanded. See
description for details.
Johannes Rainer
## Read a data.frame with collapsed columns mz and intensity columns
dr <- system.file("xml/", package = "CompoundDb")
msms_spctra <- msms_spectra_hmdb(dr)
msms_spctra
## Columns mz and intensity are "collased"
msms_spctra$mz
## Expand the data.frame to get one row per m/z and intensity value
spctra_exp <- expandMzIntensity(msms_spctra)
spctra_exp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.