gb_cache: Caching geoBoundaries downloaded files

gb_cacheR Documentation

Caching geoBoundaries downloaded files

Description

Manage cached geoBoundaries downloaded files

Usage

gb_set_cache(path)

gb_get_cache(create = FALSE)

gb_clear_cache(force = FALSE)

gb_list_cache(full_path = FALSE)

gb_delete_from_cache(file)

Arguments

path

character; path of the directory to set

create

logical; if TRUE create missing cache

force

logical; force delete. default: FALSE

full_path

logical; if TRUE returns the full path of the file

file

Character, the file to delete

Details

The default cache directory is ⁠~/.cache/R/gb_cache⁠, but you can set your own path using gb_set_cache(path)

Value

the cache directory

list of files in the cache

Note

This function will clear all cached files

Examples

## Not run: 
gb_cache
## change the default cache directory
tmp <- tempdir()
gb_set_cache(tmp)

## print current cache directory
gb_get_cache()

## List available files in the current cache directory
gb_list_cache()

l <- gb_list_cache()[1] ## get the first file
gb_delete_from_cache(l) ## delete it

gb_clear_cache() ## delete all cached files

## End(Not run)

dickoa/rgeoboundaries documentation built on Nov. 22, 2024, 12:17 p.m.