#' add_description
#'
#' The add_description function adds a description to the description table.
#'
#' @param input A vector of stats_units to be added or an AnalysR env
#' @param label Label to write in description table
#'
#' @export
add_description <- function(input, label) {
model <- analysr_env
if (!is.vector(input)) {
model <- input
stat_units <- unique(dplyr::pull(model$selection, stat_unit))
} else {
stat_units <- unique(input)
}
if (model$space_to_underscore) {
label <- gsub(" ", "_", label)
}
hash <- dplyr::filter(model$stat_units, stat_unit %in% stat_units)$hash
n <- length(hash)
result <- tibble::tibble(hash = hash, type = rep(label, n), value = TRUE)
model$descriptions <- rbind(model$descriptions, result)
model
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.