Ask Yes-No Questions

Asks Yes-No questions with variable or custom responses.

lifecycle Travis-CI BuildStatus AppVeyor BuildStatus codecov License:GPL2 CRAN_Status_Badge CRANDownloads


Provides two functions.

The first, yesno(), asks a custom yes-no question with three variable responses.

The order and phrasing of the possible responses varies randomly to ensure the user consciously chooses (as opposed to automatically types their response).

The second, yesno2(), ask a yes-no question with two custom responses.


yesno("Do you like ", R.Version()$nickname ,"?")
Do you like Bug in Your Hair?
1: Definitely
2: No way
3: No

Selection: 1
[1] TRUE

yesno("Do you like ", R.Version()$nickname ,"?")
Do you like Bug in Your Hair?
1: No way
2: Uhhhh... Maybe?
3: I agree

Selection: 2
Do you like this question?
1: I really do
2: No

Selection: 1
[1] TRUE


To install the latest development version from GitHub

# install.packages("devtools")

Alternatively install the latest development version from the Poisson drat repository using

# install.packages("drat")


To cite package 'yesno' in publications use:

  Hadley Wickham and Joe Thorley (2018). yesno: Ask Yes-No
  Questions. R package version 0.0.3.

A BibTeX entry for LaTeX users is

    title = {yesno: Ask Yes-No Questions},
    author = {Hadley Wickham and Joe Thorley},
    year = {2018},
    note = {R package version 0.0.3},
    url = {},


Please report any issues.

Pull requests are always welcome.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


  • The yesno() function is based on the internal function with the same name from devtools (modified to return TRUE if the user answers yes).


yesno 0.1.0

  • Added yesno2 function to provide two custom responses.

yesno 0.0.2

  • Replaced yesno function's string argument with ... to allow it to take variable arguments. The arguments are first pasted without separators and collapsed using paste0(..., collapse = "") before being output using cat.

yesno 0.0.1

Implemented yesno function with single string argument.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.2 by Joe Thorley, a year ago

Report a bug at

Browse source code at

Authors: Joe Thorley [aut, cre] , Hadley Wickham [aut]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports utils

Suggests testthat, covr

Imported by available, cordillera, sims, ypr.

See at CRAN