mout: Miscellaneous functions for outputting via message()

Description Usage Arguments Value Author(s) Examples

View source: R/mout.R

Description

Miscellaneous functions for outputting via message(). These "m*" methods work analogously to their corresponding "*" methods print(), cat(), show, str, and printf() but uses message() to output the content, which in turn outputs to standard error. The mout() method can be used for all other output methods, e.g. mout(write(x, file=stdout())).

Usage

1
mout(..., appendLF=FALSE)

Arguments

...

Arguments passed to the underlying output method.

appendLF

A logical specifying whether to append a newline at the end or not.

Value

Returns what the message() returns.

Author(s)

Henrik Bengtsson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  print(letters[1:8])
  mprint(letters[1:8])

  cat(c(letters[1:8], "\n"))
  mcat(c(letters[1:8], "\n"))

  str(letters[1:8])
  mstr(letters[1:8])

  printf("x=%d\n", 1:3)
  mprintf("x=%d\n", 1:3)

Example output

Loading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
R.oo v1.24.0 (2020-08-26 16:11:58 UTC) successfully loaded. See ?R.oo for help.

Attaching package:R.ooThe following object is masked frompackage:R.methodsS3:

    throw

The following objects are masked frompackage:methods:

    getClasses, getMethods

The following objects are masked frompackage:base:

    attach, detach, load, save

R.utils v2.10.1 (2020-08-26 22:50:31 UTC) successfully loaded. See ?R.utils for help.

Attaching package:R.utilsThe following object is masked frompackage:utils:

    timestamp

The following objects are masked frompackage:base:

    cat, commandArgs, getOption, inherits, isOpen, nullfile, parse,
    warnings

[1] "a" "b" "c" "d" "e" "f" "g" "h"
[1] "a" "b" "c" "d" "e" "f" "g" "h"
a b c d e f g h 
a b c d e f g h 
 chr [1:8] "a" "b" "c" "d" "e" "f" "g" "h"
 chr [1:8] "a" "b" "c" "d" "e" "f" "g" "h"
x=1
x=2
x=3
x=1
x=2
x=3

R.utils documentation built on Sept. 26, 2021, 9:07 a.m.