avgSpectra.Rd
Combines spectral replicates either by averaging (method = "mean") or
summing (method = "sum") the intensity values across each row representing a
mass-to-charge value in full_mz
.
avgSpectra(dat, method = "mean", spectra_cols)
dat | The mapped spectral data frame, containing |
---|---|
method | A character string; the method used to combine the spectra. Methods include "sum" and "mean". Default = "mean." |
spectra_cols | A character vector; the names of the column in
|
Returns a new column in the input data frame containing the averaged intensity data.
https://github.com/wesleyburr/subMaldi
Kristen Yeh <kristenyeh@trentu.ca> Wesley Burr <wesleyburr@trentu.ca> Sophie Castel <sophie.castel@ontariotechu.net>
## Load sample dataset "Master.rda" data("Master") ## Average blank spectrum 1 and 2 using the method "mean" ex <- avgSpectra(Master, method = "mean", spectra_cols = c("Blank1", "Blank2")) ## Average blank spectrum 1 and 2 using the method "sum" ex <- avgSpectra(Master, method = "sum", spectra_cols = c("Blank1", "Blank2"))