cache_dataset | R Documentation |
The dataverse package uses disk and session caches to improve network performance. Use of the cache is described on this page.
cache_dataset(version)
cache_path()
cache_info()
cache_reset()
version |
A character specifying a version of the dataset.
This can be of the form |
Use of the cache is determined by the value of the use_cache =
argument to dataset and other API calls, or by the environment variable DATAVERSE_USE_CACHE
. Possible values are
"none"
: do not use the cache. This is the default for datasets that are versioned with ":draft"
, ":latest"
, and ":latest-published"
.
"session"
: cache API requests for the duration of the R session. This is the default for API calls that do not involve file or dataset retrieval.
'"disk": use a permanent disk cache. This is the default for files and explicitly versioned datasets.
cache_dataset()
determines whether a dataset or file should be cached based on the version specification.
cache_path()
finds or creates the location (directory) on the file system containing the cache.
cache_info()
queries the cache for information about the name, size, and other attributes of files in the cache. The file name is a 'hash' of the function used to retrieve the file; it is not useful for identifying specific files.
cache_reset()
clears all downloaded files from the disk cache.
cache_dataset()
returns "disk"
if the dataset version is to be cached to disk, "none"
otherwise.
cache_path()
returns the file path to the directory containing the cache.
cache_info()
returns a data.frame containing names and sizes of files in the cache.
cache_reset()
returns the path to the (now empty) cache, invisibly)
cache_dataset(":latest") # "none"
cache_dataset("1.2") # "disk"
## Not run:
# specifying the version will by default store a cache. Add `use_cache = "none"` to turn off
df_tab <-
get_dataframe_by_name(
filename = "roster-bulls-1996.tab",
dataset = "doi:10.70122/FK2/HXJVJU",
server = "demo.dataverse.org",
version = "3"
)
## End(Not run)
cache_path()
cache_info()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.