sen2r (version 1.2.1)

print_message: Print a message

Description

A common interface for printing messages of several types.

Usage

print_message(..., type, sep = "", date = FALSE, date_format = "")

Arguments

...

R objects which are concatenated.

type

Type of the output .Accepted values:

  • 'message' for a diagnostic message;

  • 'string' for a character output;

  • 'cat' for the output of cat function;

  • 'error' and 'warning' for an error or warning message.

Intentionally, no default value is defined.

sep

(optional) character used to separate input values (default is nothing).

date

Logical value: set TRUE to place the date before the message (useful for logs or time consuming operations); default is FALSE.

date_format

Format of the date (see strftime) for the definition of the format). The default format is "%Y-%m-%d %H:%M:%S".

Value

Message (in the defined format).

Details

Several functions print messages in different formats (message, error, warning, cat, R output) and with different syntaxes (concatenating parameters or accepting a single argument, appending a new line, etc.). This accessory function provides a common interface for different types: several arguments are accepted and concatenated with the sep argument; the format is defined with the format argument; a date is optionally placed before the message.