R/cm0.R

Defines functions cm0

Documented in cm0

#' Removes columns/proteins based on fraction of entries equal 0
#'
#' @param data expression data
#' @param threshold minimum fraction of entries to be above 0
#'
#' @return
#' @export
#'
#'
cm0 <- function(data, threshold = 1) {

  v <- apply(data, 2, FUN = function(x) {sum(x > 0) / length(x) >= threshold})

  data[, v]

}
nicohuttmann/htmnanalysis documentation built on Dec. 6, 2020, 3:02 a.m.