msg: Return Message Strings

View source: R/msg.R

msgR Documentation

Return Message Strings

Description

Functions to build and report message strings.

Usage

msg(x, ...)

## Default S3 method:
msg(x, msg = "", echo = FALSE, ...)

## S3 method for class 'data.frame'
msg(x, msg = "", key, names, echo = FALSE, ...)

Arguments

x

Object.

msg

Character string specifying the message to be returned.

echo

Logical value specifying whether to print strings to the R console.

key

Character string specifying an index key.

names

Character string specifying variable names to be included in the output string.

Value

Character string of concatenated data fields and messages (invisible).

Methods (by class)

  • default: Default msg method.

  • data.frame: Generate message from data frame entries.

Examples

x <- data.frame(year = 2010:2014, site = LETTERS[1:5])
key(x) <- "year"  # Define index key.

# Console output:
msg(x, "Sampling was performed.", echo = TRUE)
msg(x, paste("Record number", 1:nrow(x), "is ok."), echo = TRUE)

# String output:
m <- msg(x, "Sampling was performed.")


TobieSurette/gulf.manage documentation built on Feb. 10, 2024, 10:51 p.m.