.artifactr <- new.env(parent = emptyenv())
.artifactr$name <- character()
.artifactr$fun <- c()
.artifactr$args <- c()
.artifactr$quote <- c()
.artifactr$envir <- c()
#' @export
unregister_data <- function(name) {
ind <- which(name == .artifactr$name)
if (length(ind) > 0) {
.artifactr$name <- .artifactr$name[-ind]
.artifactr$fun <- .artifactr$fun[-ind]
.artifactr$args <- .artifactr$args[-ind]
.artifactr$quote <- .artifactr$quote[-ind]
.artifactr$envir <- .artifactr$envir[-ind]
}
invisible(TRUE)
}
#' @export
register_rdata <- function(name, fun, args, quote = FALSE,
envir = parent.frame(), overwrite = TRUE) {
if (name %in% .artifactr$name && overwrite == FALSE) {
stop("Artifact name already exists")
}
unregister_data(name)
.artifactr$name <- c(.artifactr$name, name)
.artifactr$fun <- c(.artifactr$fun, fun)
.artifactr$args <- c(.artifactr$args, args)
.artifactr$quote <- c(.artifactr$quote, quote)
.artifactr$envir <- c(.artifactr$envir, envir)
invisible(TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.