cancelbox: Confirm Cancelation

Description Usage Arguments Examples

View source: R/cancelbox.R

Description

Sometimes when you ask someone for data, they don't feel like sharing. This function helps you with this situation. This provides a dialog box that confirms whether a user wants to cancel a script. It is intended to follow an rstudio::showPrompt dialog box where the user decides to hit cancel. If the user is not using RStudio, or their version of RStudio is not 1.1.67 or greater, it will use menu() to ask in the console. Because portability.

Usage

1
2
3
cancelbox(cancel_title = "Stop Script?",
  cancel_message = "I'm sorry, but your input is required to proceed. Are you sure you want to stop running this script?",
  cancel_ok = "Yes", cancel_cancel = "No", ...)

Arguments

cancel_title

The title of the dialog box

cancel_message

The message confirming if the user would like to cancel

cancel_ok

The

cancel_cancel

User input option that will return FALSE

...

Used to handle arguments intended for other functions, as cancelbox() is a helper function

cancel_ok

User input option that will cancel the script

Examples

1
2
x <- showPrompt(title = "Your Name", message = "Please enter your name.", default = "Jerry")
if(is.null(x)) {cancelbox()}

spenceredwin/boxit documentation built on Nov. 5, 2019, 9:15 a.m.