| download_cache | R Documentation |
Lists or clears the data downloaded from the NIST Atomic Spectra Database, STARK-B and ExoMol and kept on disk, so that they are reused in later sessions and without an internet connection.
download_cache()
clear_download_cache(source = c("nist", "starkb", "exomol"), older_than = NULL)
source |
The sources to clear: |
older_than |
Clear only the entries older than this number of days,
or |
Downloaded data are always kept for the R session. To keep them between
sessions, set the option specProc.cache, for example in your
.Rprofile:
options(specProc.cache = TRUE) keeps them in the user cache
directory of specProc, given by tools::R_user_dir();
options(specProc.cache = "path/to/dir") keeps them in that
directory;
NULL or FALSE (default) keeps them for the session only.
The results of nist_lines(), nist_ionization_energy(),
nist_levels() (and so libs_lines() and line_finder()),
starkb_lines() and molecular_spectrum() are then read from the cache
when they are there. Entries older than the option
specProc.cache_max_age (in days, default 180) are downloaded again, as
the databases are updated; when the download fails, the older copy is used
with a warning. The NIST and STARK-B entries are small (a few kilobytes
to a megabyte); ExoMol line lists can be large, see exomol_datasets().
The cache can also be cleared by deleting its directory.
download_cache(): a tibble with one row per file of the
persistent cache, with its source, file name, size (kB),
modified time and age (days); its directory is the attribute
dir (NULL when the cache is not enabled). clear_download_cache():
invisibly, the paths of the deleted files. It also clears the session
cache of the sources.
Christian L. Goueguel
nist_lines(), starkb_lines(), molecular_spectrum()
# keep the downloaded data in a directory (here a temporary one)
old <- options(specProc.cache = file.path(tempdir(), "specProc-cache"))
download_cache()
clear_download_cache()
options(old)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.