Add note to log file and/or standard output

DESCRIPTION:

Add a note to log file and/or standard output formatted in standardized way.

USAGE:

logcat(..., label="Note")

REQUIRED ARGUMENTS:

...
The text of the note. These are passed on to the cat function for printing.

OPTIONAL ARGUMENTS:

label
The label for the note. This can be up to 7 characters long and will be right justified in the first 7 characters of each output line, followed by a space.

DETAILS:

If the environment variable S_LOGFILE is defined, then logcat(message) will write the label "Note" and the message to end of the file given by getenv("S_LOGFILE") . If options()$verbose is TRUE, the label and message will be written to the standard output also.

EXAMPLES:

options(verbose=T)
setenv("S_LOGFILE", "slogfile.txt")
logcat("The dataset fuel.frame has dimensions", nrow(fuel.frame), "by", ncol(fuel.frame))
# Note The dataset fuel.frame has dimensions 60 by 5
# The file slogfile.txt should contain the same note.