R/extract_numeric_part.R

Defines functions extract_numeric_part

Documented in extract_numeric_part

#' Extract the numerical part from the count matrix
#'
#' Helper function to extract the numerical part of the matrix
#' @importFrom magrittr "%>%"
#' @export

extract_numeric_part <- function(counts) {

  if (sum(sapply(counts, is.numeric)) < 2) {
    stop("`counts` contains less than 2 numerical columns", call. = FALSE)
  }

  counts %>%
    dplyr::select_if(is.numeric)
}
jeslipp/tabletools documentation built on May 14, 2019, 9:36 a.m.