#' option
#'
#' Processes a simple option or a key value pairs of options separated by commas.
#'
#' @param opts character: simple option or a key value pairs of options
#'
#' @return nothing
#' @export
#' @md
#'
#' @examples
#' # simple option
#' opt <- option("run")
#' opt
#' # key-value options
#' opt <- option("int=2,text=hello,boolean=T")
#' opt
option <- function (opts) {
expr <- parse(text=paste0("list(", opts, ")"))
vars <- all.vars(expr)
env <- new.env()
if (length(vars)) {
for (i in 1:length(vars)) env[[vars[i]]] <- vars[i]
}
eval(expr, env)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.