vmessage: Display the message if criteria are met

View source: R/verbose_message.R

vmessageR Documentation

Display the message if criteria are met

Description

Sometimes you want to display a message not only when certain criteria are met but also only if you've asked a function to be verbose

Usage

vmessage(
  string,
  criteria = NULL,
  criteria_relationship = "all",
  type = "message",
  verbose = TRUE
)

Arguments

string

Character string. The text to display.

criteria

Optional logical vector. One or more logical values or statements, e.g. c(length(vector) > 1, is.character(vector)). These are compared/combined according to criteria_relationship. Defaults to TRUE.

criteria_relationship

Character string. The approach to comparing/combining the values in criteria. Valid options are "all" (resolves criteria to TRUE if all values in criteria are TRUE), "any" (resolves criteria to TRUE if any of the values in criteria are TRUE), "xor" (resolves criteria to TRUE if only one value in criteria is TRUE), and "none" (resolves criteria to TRUE if all values in criteria are FALSE). Defaults to "all".

type

Character string. Which function to use to relay string, message() or warning(). Valid values are "message" and "warning". Defaults to "message".

verbose

Logical value. Intended to take the logical value from the parent function signalling whether or not it should be verbose, string will only be relayed to the user if this is TRUE. Defaults to TRUE.


nstauffer/aim.analysis documentation built on Nov. 2, 2023, 12:52 a.m.