From 6afba3c0b83156d787769765e9168d13aaea5b0f Mon Sep 17 00:00:00 2001 From: Konstantin Pelz Date: Thu, 9 Sep 2021 10:47:16 +0000 Subject: [PATCH] functions.R edited online with Bitbucket --- R/functions.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/R/functions.R b/R/functions.R index e1ee1ca..e28ace1 100644 --- a/R/functions.R +++ b/R/functions.R @@ -693,3 +693,19 @@ buildSignatureMatrixMAST <- function(scdata, return(Sig) } + +#' A wrapper function whether to suppress messages +#' +#' @param verbose Whether to produce an output on the console. +#' +#' @return A function which will suppress messages or not, depending on the verbose parameter +#' +verbose_wrapper <- function(verbose) { + return(function(method) { + if (!verbose) { + suppressMessages(method) + } else { + method + } + }) +} \ No newline at end of file