Learn R Programming

pmartR (version 2.4.6)

edata_replace: Replace Values Equal to x with y

Description

This function finds all values of x in the e_data element of omicsData and replaces them with y

Usage

edata_replace(omicsData, x, y, threshold = NULL)

Value

data object of the same class as omicsData

Arguments

omicsData

an object of the class 'pepData', 'proData', 'metabData', 'lipidData', or 'nmrData' created by as.pepData, as.proData, as.metabData, as.lipidData, or as.nmrData, respectively.

x

value to be replaced, usually numeric or NA

y

replacement value, usually numeric or NA

threshold

Positive numeric value. Observed values below this threshold will be replaced by `y` (in addition to all `x` values).

Author

Kelly Stratton

Details

This function is often used to replace any 0 values in peptide, protein, metabolite, or lipid data with NA's. For omicsData on the abundance scale, when the omicsData object is created, any 0's in e_data are automatically converted to NA's. For omicsData on the count scale (e.g. seqData objects), when the omicsData object is created, any NA's in e_data are automatically converted to 0's.

Examples

Run this code
if (FALSE) { # requireNamespace("pmartRdata", quietly = TRUE)
library(pmartRdata)
mymetab <- edata_replace(omicsData = metab_object, x = 0, y = NA)
}

Run the code above in your browser using DataLab