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())).

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

Henrik Bengtsson

Examples

  print(letters[1:8])
#> [1] "a" "b" "c" "d" "e" "f" "g" "h"
  mprint(letters[1:8])
#> [1] "a" "b" "c" "d" "e" "f" "g" "h"

  cat(c(letters[1:8], "\n"))
#> a b c d e f g h 
  mcat(c(letters[1:8], "\n"))
#> a b c d e f g h 

  str(letters[1:8])
#>  chr [1:8] "a" "b" "c" "d" "e" "f" "g" "h"
  mstr(letters[1:8])
#>  chr [1:8] "a" "b" "c" "d" "e" "f" "g" "h"

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