View source: R/put_eurostat_cache.R
put_eurostat_cache | R Documentation |
Save the object (dataset/toc/DSD) to cache
put_eurostat_cache(
obj,
oname,
update_cache = FALSE,
cache_dir = NULL,
compress_file = TRUE
)
obj |
an object (toc, dataset, DSD) |
oname |
a character string with the name of the object to reference later in the cache |
update_cache |
a logical with a default value |
cache_dir |
a path to a cache directory. The default is |
compress_file |
a logical whether to compress the RDS-file in caching. Default is |
Saves a given object in cache. This can be the memory .restatapi_env
or on the hards disk. If the given cache_dir
does not exist then the file is saved in the R temp directory (tempdir()
). If the file or object with the oname
exists in the cache, then the object is not cached.
The function returns the place where the object was cached: either it creates an the object in the memory ('.restatapi_env') or creates an RDS-file.
dt<-data.frame(txt=c("a","b","c"),nr=c(1,2,3))
put_eurostat_cache(dt,"teszt")
get("teszt",envir=restatapi::.restatapi_env)
put_eurostat_cache(dt,"teszt",cache_dir=tempdir())
readRDS(file.path(tempdir(),"teszt.rds"))
clean_restatapi_cache(cache_dir=tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.