Skip to contents

This function is a wrapper around utils::menu() that returns the index of the first choice instead of the index of the selected choice. This is useful when you want to ask a question with only one choice and you want to return a logical value.

Usage

menu_first(choices, graphics = FALSE, title = NULL)

Arguments

choices

a character vector of choices

graphics

a logical indicating whether a graphics menu should be used if available.

title

a character string to be used as the title of the menu. NULL is also accepted.