R/messagef.R

Defines functions messagef

Documented in messagef

#' Wrapper for message and sprintf.
#'
#' A simple wrapper for \code{message(sprintf(...))}.
#'
#' @param ... [any]\cr
#'   See \code{\link{sprintf}}.
#' @param .newline [logical(1)]\cr
#'   Add a newline to the message. Default is \code{TRUE}.
#' @return Nothing.
#' @export
#' @examples
#' msg = "a message"
#' warningf("this is %s", msg)
messagef = function(..., .newline = TRUE) {
  message(sprintf(...), appendLF = .newline)
}

Try the BBmisc package in your browser

Any scripts or data that you put into this service are public.

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.