rmveEmpty: Remove Empty Rows

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/rmveEmpty.R

Description

Data frames created using createSpecDF can have thousands to millions of rows, especially when dealing with high resolution mass spectrometry data. This can be quite taxing to the speed of executing certain functions, especially when it comes to visualizing data. This function removes empty rows to reduce the computational load and increase the ease of use of functions on the data frame. Any row where all elements (but the first, which is full_mz) equal 0 are removed from the data frame.

Usage

1
rmveEmpty(dat)

Arguments

dat

The spectral data frame, containing full_mz in the first column, to be trimmed of all-zero rows.

Value

Returns the input data frame without its all-zero rows.

Note

Avoid truncating a dataframe until all samples to be compared have been mapped.

Author(s)

Kristen Yeh <kristenyeh@trentu.ca>

References

https://github.com/wesleyburr/subMaldi

See Also

createSpecDF,mapSpectrum

Examples

1
2
3
4
5
6
7
8
9
## Load sample dataset "Mastre.rda"
data("Master")

## Select only the spectra "Before1" and "Before2"
ex <- dplyr::select(Master, "full_mz", "Before1", "Before2")

## Use rmveEmpty(x) on those data frames to reduce computational load for use with
# other functions and packages
ex <- rmveEmpty(dat = ex)

wesleyburr/subMaldi documentation built on Oct. 1, 2021, 7:07 a.m.