Nothing
#' Prompt for dataset in the console
#' @name promptDatasets
#' @importFrom utils data menu
#' @param package a character vector with the names of packages to search through, or NULL in which "all" packages (as defined by argument all) are searched.
#' @param lib.loc a character vector of directory names of R libraries, or NULL. The default value of NULL corresponds to all libraries currently known.
#' @param all logical; if TRUE search all available packages in the library trees specified by lib.loc, and if FALSE, search only attached packages.
#' @param drop.defaults logical; if TRUE, do not include the datasets from the datasets package.
#' @export
promptDatasets <- function(package = NULL, lib.loc = NULL, all=TRUE, drop.defaults=FALSE) {
# return dataset info
dtsts <- datasets(package, lib.loc, all, drop.defaults)
# prompt which dataset to load
choice <- utils::menu(dtsts[,3])
# find corresponding package
pkgs <- dtsts[choice,1]
# find corresponding dataset
dtsts <- dtsts[choice,2]
return( utils::data(list=dtsts, package=pkgs) )
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.