yesno2: Yes No with Two Custom Responses

Description Usage Arguments Details Value See Also Examples

View source: R/yesno2.R

Description

Asks a custom yes-no question with two responses (by default 'Yes' or 'No'). Returns a flag indicating which response the user choose. It is designed to be used in situations where a user needs to choose one of two affirmative options.

Usage

1
yesno2(..., yes = "Yes", no = "No")

Arguments

...

Objects to paste and then output to produce the question.

yes

A string of the first response.

no

A string of the second response.

Details

The objects are first pasted without separators and collapsed using [paste0](..., collapse = "") before being output using cat().

Selection of a 0 (to exit) causes the code to throw an error.

Value

A flag indicating whether the user selected the first (TRUE) or second (FALSE) response.

See Also

yesno()

Examples

1
2
3
4
## Not run: 
yesno2("Do you like this question?", yes = "I really do")

## End(Not run)

poissonconsulting/yesno documentation built on Nov. 18, 2021, 9:31 p.m.