Learn R Programming

ribiosUtils (version 1.7.7)

qqmsg: Quitely Quit with Messages

Description

Quitely quit R with messages in non-interactive sessions

Usage

qqmsg(..., status = 0, save = FALSE, runLast = TRUE)

Value

Invisible NULL, only side effect is used.

Arguments

...

Messages to be passed to message

status

Quit stats

save

Logical, should current working environment be saved?

runLast

Logical, should .Last() be executed?

Author

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

Details

The function prints messages in any case, and quits R if the current session is non-interactive, e.g. in the command-line running Rscript mode

See Also

Examples

Run this code

## the example should not run because it will lead the R session to quit
if (FALSE) {
  qqmsg()
  qqmsg("die", status=0)
  qqmsg("Avada kedavra", status=-1)
  qqmsg("Crucio!", "\n", "Avada kedavra", status=-100)
}

Run the code above in your browser using DataLab