pause: pauses the program until an answer is given

Description Usage Arguments Details Value Examples

View source: R/rbsa0.code.r

Description

This function issues a pause with a message allowing to stop the process or to continue it (without or with and according to the answer given by the user).

Usage

1
2
 
  pause(what="",mensaje=NULL,top=0,ans=NULL) 

Arguments

what

Short message commenting the pause

mensaje

A possible longer message to give details. When NULL a shortened message is issued.

top

Precises the rules to follow for the execution to be stopped (see the details section).

ans

Precises the accepted answers (see the details section).

Details

The answer provided by the user is interpreted as a character(1).
When top is NA the call is ignored.
When top is NULL no stopping is possible but the answer is returned. This answer can be anything when is.na(ans) but a void answer is refused. This answer can be anything including nothing when is.null(ans). The answer is returned.
When top is numeric, ans is not considered. an empty answer allows the process to follow and no void answers stop the process.
When top and ans are characters, the only accepted answers are a component of top (to stop the process) or a component of ans (to be returned).
When top is a character and is.null(ans) | is.na(ans) stopping is made when the answer is one of the components of top, other answers will be returned.

Value

When the process is not stopped, returns the answer provided by the user.

Examples

1
2
3
4
5
 
  pause("Time for lunch!",top=NA); 
  ## Not run: pause("Time for lunch?") 
  ## Not run: pause("Look at your results before the process continue",top=NULL) 
  ## Not run: pause("Can we continue?",top=c("n","N","no","NO"),ans=c("y","Y","yes","YES")) 

rbsa documentation built on May 2, 2019, 6:07 p.m.