cleanAssay | R Documentation |
Generate function to filter rows/columns with NAs exceeding a threshold
cleanAssay(by = c("row", "col"))
by |
Whether to filter by rows or columns |
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
.
A function to filter assay rows/columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.