testing: Print Object Names and Values

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Outputs the objects names and values.

Usage

1
testing(..., prefix = " Testing > > > \n")

Arguments

...

R objects.

prefix

character string to be printed before values.

Details

This function is useful for debugging where it can be useful to know the name of the object associated with the displayed value.

The actual printout depends on option getOption("amisc.testing"). If it is set to FALSE (default) nothing happens. If set to options(amisc.testing = TRUE) test output is produced.

Value

None (invisible NULL).

Author(s)

Andrej Blejec andrej.blejec@nib.si

See Also

To control options see options and .onLoad, cat for print controls.

Examples

1
2
3
4
5
6
7
8
9
.oldOpt <- options(amisc.testing = TRUE)
x <- 3.14
testing(x)
y <- 1:5
testing(y, prefix="-------------> \n...")
options(amisc.testing = FALSE)
testing(y)
options(.oldOpt) # reset option
rm(.oldOpt)

ablejec/amisc documentation built on May 10, 2019, 4:13 a.m.