get_eurostat_cache: Load an object from cache

Description Usage Arguments Details Value Examples

View source: R/get_eurostat_cache.R

Description

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

Usage

1
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 boolean 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

1
2
3
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 July 24, 2019, 1:05 a.m.