File: messagef.R

package info (click to toggle)
r-cran-bbmisc 1.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,256 kB
  • sloc: ansic: 176; sh: 9; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 454 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#' @title Wrapper for message and sprintf
#'
#' @description
#' 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)
}