This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Wraps ggsave to produce both light and dark themed plot using ggdark. | |
dark_save <- function(filename, plot, sep = "-", ...) { | |
require(tools) | |
require(ggdark) | |
base <- file_path_sans_ext(filename) | |
ext <- file_ext(filename) | |
base_light <- paste(base, "light", sep = "-") | |
base_dark <- paste(base, "dark", sep = "-") | |
filename_light <- paste(base_light, ext, sep = ".") | |
filename_dark <- paste(base_dark, ext, sep = ".") |
OlderNewer