ts_show_ref_cache() lists the files that ts_load_ref() has downloaded; ts_clear_ref_cache() deletes them. Neither uses the internet.

ts_show_ref_cache(cache_dir = NULL)

ts_clear_ref_cache(cache_dir = NULL, older_than = NULL, ask = interactive())

Arguments

cache_dir

Character; the folder to look in. Default NULL.

older_than

Numeric; only delete files last modified more than this many days ago. Default NULL (delete all).

ask

Logical; ask before deleting? Default TRUE in an interactive session. There is never a prompt when not interactive.

Value

ts_show_ref_cache() returns a dataframe with one row per file: the original file name, size (such as "121.7 MB"), modified and path. It is empty if there is nothing in the folder. ts_clear_ref_cache() invisibly returns the paths of the deleted files.

Details

The folder is cache_dir if given, otherwise the folder in the option taxastand.cache_dir if set, otherwise a folder in tempdir() (removed when R closes). Only files made by ts_load_ref() (names like 1a2b3c4d-name.zip, and .part files left by a failed download) are listed or deleted; other files in the folder are never touched.

Examples

ts_show_ref_cache()
#> No downloaded files in /tmp/Rtmpr94jwr/taxastand
#> [1] file     size     modified path    
#> <0 rows> (or 0-length row.names)
ts_clear_ref_cache()
#> Nothing to delete in /tmp/Rtmpr94jwr/taxastand