get_eurostat_cache: Load an object from cache

View source: R/get_eurostat_cache.R

get_eurostat_cacheR Documentation

Load an object from cache

Description

Search and load the object (dataset/toc/DSD) from cache

Usage

get_eurostat_cache(oname, cache_dir = NULL, verbose = FALSE)

Arguments

oname

a character string with the name of the object (toc, dataset id, DSD id)

cache_dir

a path to a cache directory to search in. The default is NULL, in this case the object is searched in the memory (in the .restatapi_env). Otherwise if the cache_dir directory does not exist it searches the 'restatapi' directory in the temporary directory from tempdir(). Directory can also be set with options(restatapi_cache_dir=...).

verbose

a logical value with default FALSE, so detailed messages (for debugging) will not printed. Can be set also with options(restatapi_verbose=TRUE).

Details

If the given name or the beginning of the name (for datasets) found in the cache then it returns the value of the object otherwise it returns NULL.

Value

the requested object if exists in the '.restatapi_env' or in the cache_dir, otherwise it returns the NULL value.

Examples


dt<-data.frame(txt=c("a","b","c"),nr=c(1,2,3))
put_eurostat_cache(dt,"teszt")
get_eurostat_cache("teszt",verbose=TRUE)



restatapi documentation built on Sept. 19, 2023, 5:08 p.m.