cleanAssay: Generate function to filter rows/columns with NAs exceeding a...

View source: R/utils.R

cleanAssayR Documentation

Generate function to filter rows/columns with NAs exceeding a threshold

Description

Generate function to filter rows/columns with NAs exceeding a threshold

Usage

cleanAssay(by = c("row", "col"))

Arguments

by

Whether to filter by rows or columns

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.

Value

A function to filter assay rows/columns


biobenkj/compartmentalizer documentation built on June 10, 2025, 1:57 a.m.