messageColoured: Use 'message' with a consistent use of 'verbose'

View source: R/helpers.R

messageDFR Documentation

Use message with a consistent use of verbose

Description

This family has a consistent use of verbose allowing messages to be turned on or off or verbosity increased or decreased throughout the family of messaging in reproducible. messageDF uses message to print a clean square data structure. messageColoured allows specific colours to be used. messageQuestion sets a high level for verbose so that the message always gets asked.

Usage

messageDF(
  df,
  round,
  colour = NULL,
  colnames = NULL,
  verbose = getOption("reproducible.verbose"),
  verboseLevel = 1,
  appendLF = TRUE
)

messageQuestion(..., verboseLevel = 0, appendLF = TRUE)

messageColoured(
  ...,
  colour = NULL,
  verbose = getOption("reproducible.verbose", 1),
  verboseLevel = 1,
  appendLF = TRUE
)

Arguments

df

A data.frame, data.table, matrix

round

An optional numeric to pass to round

colour

Any colour that can be understood by crayon

colnames

Logical or NULL. If TRUE, then it will print column names even if there aren't any in the df (i.e., they will) be V1 etc., NULL will print them if they exist, and FALSE which will omit them.

verbose

Numeric, -1 silent (where possible), 0 being very quiet, 1 showing more messaging, 2 being more messaging, etc. Default is 1. Above 3 will output much more information about the internals of Caching, which may help diagnose Caching challenges. Can set globally with an option, e.g., ⁠options('reproducible.verbose' = 0) to reduce to minimal⁠

verboseLevel

The numeric value for this ⁠message*⁠ call, equal or above which verbose must be. The higher this is set, the more unlikely the call will show a message.

appendLF

logical: should messages given as a character string have a newline appended?

...

zero or more objects which can be coerced to character (and which are pasted together with no separator) or (for message only) a single condition object.

Value

Used for side effects. This will produce a message of a structured data.frame.


reproducible documentation built on Nov. 22, 2023, 9:06 a.m.