setDebug: Functions for command-line Rscript debugging

Description Usage Details Value Author(s) Examples

View source: R/scripting.R

Description

These functions are used to debug command-line executable Rscripts in R sessions

Usage

1

Details

setDebug sets the environmental variable RIBIOS_SCRIPT_DEBUG as TRUE. unsetDebug unsets the variable. isDebugging checks whether the variable is set or not. isIntDebugging tests whether the scripts runs interactively or runs in the debugging mode. The last one can be useful when debugging Rscript in a R session.

A programmer wishing to debug a Rscript can explicitly set (or unset) the RIBIOS_SCRIPT_DEBUG variable in order to activate (inactivate) certain trunks of codes. This can be automated via isDebugging, or probably more conveniently, by isIntDebugging: if the script runs in an interactive mode, or the debugging flag is set, the function returns TRUE.

Value

setDebug and unsetDebug returns an invisible value indicating whether the variable setting (unsetting) was successful.

isDebugging and isIntDebugging returns logical values.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

Examples

1
2
3
4
5
6
7

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.