Learn R Programming

vws (version 0.3.0)

Print: Printing

Description

Functions to print messages using an sprintf syntax.

Usage

printf(fmt, ...)

logger(fmt, ..., dt_fmt = "%Y-%m-%d %H:%M:%S", join = " - ")

fprintf(file, fmt, ...)

Value

None (invisible NULL); functions are called for side effects.

Arguments

fmt

Format string which can be processed by sprintf

...

Additional arguments

dt_fmt

Format string which can be processed by format.POSIXct

join

A string to place between the timestamp and the message.

file

A connection, or a character string naming the file to print to

Examples

Run this code
printf("Hello world %f %d\n", 0.1, 5)
logger("Hello world\n")
logger("Hello world %f %d\n", 0.1, 5)
logger("Hello world %f %d\n", 0.1, 5, dt_fmt = "%H:%M:%S")
logger("Hello world %f %d\n", 0.1, 5, join = " >> ")
logger("Hello world %f %d\n", 0.1, 5, join = " ")

Run the code above in your browser using DataLab