R/capture.R

Defines functions capture

Documented in capture

#' Capture output of function
#' 
#' Capture output of function and print to screen as a message.
#' This allows tables, summaries, etc to be printed to the console without 
#' messing up alignment of columns.
#' @param func_output Function output.
#' 
#' @return Null output.
#' @keywords internal
capture <- function(func_output){
    requireNamespace("utils")
    msg <- paste0(utils::capture.output(func_output), collapse = "\n")
    message(msg)
}
NathanSkene/MAGMA_Celltyping documentation built on Aug. 21, 2023, 8:55 a.m.