edata_replace {pmartR} | R Documentation |
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)
Arguments
omicsData |
an object of the class 'pepData', 'proData', 'metabData',
'lipidData', or 'nmrData' created by |
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). |
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.
Value
data object of the same class as omicsData
Author(s)
Kelly Stratton
Examples
library(pmartRdata)
mymetab <- edata_replace(omicsData = metab_object, x = 0, y = NA)