ask_or_default | R Documentation |
Ask a question and read from the terminal in interactive scenario
ask_or_default(..., default = "", end = "", level = "INFO")
... , end , level |
passed to |
default |
default value to return in case of blank input |
The prompt string will ask a question, providing defaults. Users need to enter the answer. If the answer is blank (no space), then returns the default, otherwise returns the user input.
This can only be used in an interactive
session.
A character from the user's input, or the default value. See details.
cat2
, readline
,
ask_yesno
if(interactive()){
ask_or_default('What is the best programming language?',
default = 'PHP')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.