#' @export
get_global_dir <- function() {
module_lib <- path.expand(
paste0(
.libPaths()[1],
"/module-library"
)
)
if (!is.null(getOption("module.dir"))) {
return(getOption("module.dir"))
} else if (file.exists(module_lib)) {
return(module_lib)
} else {
message(
"# Creating a local library for modules at: ",
module_lib
)
dir.create(module_lib)
options(
"module.dir" = module_lib
)
return(getOption("module.dir"))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.