Quick caching utility read/write functions utilizing the qs
package.
write_cache(x, name = NULL, cache_dir = "cache", overwrite = TRUE)
read_cache(x, name = NULL, cache_dir = "cache")
object to cache
name of object to read in.
path to cache directory.
logical (default = TRUE)
invisibly returns object passed to the function.
x
invisibly attaches object to parent global environment
if (FALSE) {
mydata <- mtcars
write_cache(mydata) # will save to 'cache/mydata'.
write_cache(mydata, "mydata-v2", cache_dir = "data/temp") # will save to 'data/temp/mydata-v2'
# read back in
read_cache(mydata)
}