msg | R Documentation |
Functions to build and report message strings.
msg(x, ...)
## Default S3 method:
msg(x, msg = "", echo = FALSE, ...)
## S3 method for class 'data.frame'
msg(x, msg = "", key, names, echo = FALSE, ...)
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. |
Character string of concatenated data fields and messages (invisible).
default
: Default msg method.
data.frame
: Generate message from data frame entries.
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.")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.