caching | R Documentation |
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")
x |
object to cache |
name |
name of object to read in. |
cache_dir |
path to cache directory. |
overwrite |
logical (default = TRUE) |
invisibly returns object passed to the function.
x
invisibly attaches object to parent global environment
qs::qread()
and qs::qsave()
## Not run: 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) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.