Generate function to filter rows/columns with NAs exceeding a threshold
Source:R/utils.R
cleanAssay.RdGenerate function to filter rows/columns with NAs exceeding a threshold
Usage
cleanAssay(by = c("row", "col"))Details
Since removing NAs from rows vs columns only differs by whether rowMeans or
colMeans is used, and by where the comma goes in the subset operation,
code repetition can be avoided by consolidating these operations.
This cleanAssay function can generate two functions to remove NA's from
rows and columns using the by argument based on which it selects the
appropriate 'mean' and subset functions. This maintains the clarity of
having the operation in the function name when used: cleanAssayRows and
cleanAssayCols.