# NOT RUN {
user_cache_dir("rappdirs")
# }
# NOT RUN {
# Throw this in your R profile to store a R history file in standard cache location
if(capabilities("cledit")) {
cache_dir <- rappdirs::user_cache_dir("R")
history_file <- file.path(cache_dir, "Rhistory")
.First <- function() utils::loadhistory(history_file)
.Last <- function() {
if (!file.exists(cache_dir)) dir.create(cache_dir, recursive = TRUE)
try(savehistory(history_file))
}
}
# }
Run the code above in your browser using DataLab