#' Enables to choose between options
#'
#' @param question Question to be answered
#' @param ... options what to do
#'
#' @return
#' @export
#'
#'
whatToDo <- function(question, ...) {
options <- c(...)
what <- ""
while(!(what %in% options)) {
what <- readline(paste0(question, " (", paste(options, collapse = "/"), ") "))
if(grepl("[[:digit:]]", what)) {
what <- options[as.numeric(what)]
}
}
what
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.