Description Usage Arguments Value Author(s) Examples
View source: R/utility-functions.R
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.
1 |
x |
|
data.frame with "mz" and "intensity" columns expanded. See
description for details.
Johannes Rainer
1 2 3 4 5 6 7 8 9 10 11 12 | ## 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.