#' Select Input
#'
#' Internal function that is used to select an input when multiple ones are available
#' @param folders character; input folder names, usually obtained with the \code{check_exists} function
#' @param msg character; used to modify the presentation of the different options
#' @param mostRecent logical; should the most recent input be selected? If FALSE and if there are multiple
#' available inputs, the user is interactively asked to select the input based on time.
#' @return character; time of the input folder creation
#' @keywords internal
#' @export
select_input <- function (folders, msg, mostRecent = FALSE) {
if (length(folders) > 1) {
if (!mostRecent) {
selInd <- utils::menu(paste(msg, folders), title = "\nSelect the data you would like to use.")
} else {
selInd <- length(folders)
}
if (selInd == 0) {
return(NULL)
} else {
folder <- folders[selInd]
folder <- format(folder, "%Y%m%d%H%M%S")
return(folder)
}
} else {
folder <- format(folders, "%Y%m%d%H%M%S")
return(folder)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.