clear_cache | R Documentation |
Removes cached files for a set of Hathi Trust ids
clear_cache(
htids,
dir = getOption("hathiTools.ef.dir"),
cache_type = c("ef", "meta", "pagemeta"),
cache_format = c("csv.gz", "rds", "feather", "text2vec.csv", "parquet"),
keep_json = TRUE
)
htids |
A character vector of Hathi Trust ids, a workset created with
workset_builder, or a data frame with a column named "htid" containing
the Hathi Trust ids that require caching. If the JSON Extracted Features
files for these htids have not been downloaded via rsync_from_hathi or
get_hathi_counts to |
dir |
The directory where the download extracted features files are to
be found. Defaults to |
cache_type |
Type of information to remove. The default is c("ef",
"meta", "pagemeta"), which refers to the extracted features, the volume
metadata, and the page metadata in |
cache_format |
The format of the cached EF files to remove. Defaults to c("csv.gz", "rds", "feather", "text2vec.csv", "parquet"), i.e., all formats. |
keep_json |
Whether to keep any downloaded JSON files. Default is
|
(Invisible) a character vector with the deleted paths.
Warning! This function does not double-check that you want to delete your cache. It will go ahead and do it.
dir <- tempdir()
htids <- c("mdp.39015008706338", "mdp.39015058109706")
dir <- tempdir()
cache_htids(htids, dir = dir, cache_type = "ef", attempt_rsync = TRUE)
# Clears only "csv" cache
deleted <- clear_cache(htids, dir = dir)
deleted
# Clears also JSON files
deleted <- clear_cache(htids, dir = dir, keep_json = FALSE)
deleted
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.