a character string with the name of the object to reference later in the cache
update_cache
a logical with a default value FALSE, whether to update the cache. In this case the existing value in the cache is overwritten. Can be set also with options(restatapi_update = TRUE)
cache_dir
a path to a cache directory. The default is NULL, in this case the object is saved in the memory (in the '.restatapi_env'). Otherwise if the cache_dir directory does not exist it saves in the 'restatapi' directory under the temporary directory from tempdir(). Directory can also be set with options(restatapi_cache_dir=...).
compress_file
a logical whether to compress the RDS-file in caching. Default is TRUE.
Value
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.
Details
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.