#' Save a study list as a JSON file
#'
#' Save a study list as a JSON file
#'
#' @param study A study list object created with pipeline()
#' @param filename The file path to save to
#' @return Saves study as a JSON file with the specified name
#'
#' @export
#'
save_pipeline <- function(study, filename = "study.json") {
if (!grep("\\.json$", filename)) {
# add .json extension if not already specified
filename <- paste0(filename, ".json")
}
study %>%
jsonlite::toJSON(auto_unbox = TRUE) %>%
jsonlite::prettify(indent = 2) %>%
writeLines(filename)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.