.validate_path <- function(path) {
# Check if the directory for path exists, and if not create
# Args:
# path: full path (including filename)
# Returns:
# file path to directory, sans filename (returned from dirname)
dir <- dirname(path)
if (!dir.exists(dir)) {
message("Creating:", dir)
dir.create(dir, recursive = TRUE)
}
return(dir)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.