Removes files that hydrogeofetch has written to hydrogeofetch_data_dir. Use this to reclaim space or to force downloaded data to be refreshed.
Downloaded datasets are kept until removed with this function – nothing expires them automatically – so it is worth calling periodically if you use get_vaa or add_mainstems on many different areas.
hydrogeofetch_cache_clear(what = "all", ask = interactive())character which cached data to remove. One or more of 'responses' (the `memoise` filesystem cache of web service responses), 'tiles' (basemap tiles cached by plot_nhdplus), 'vaa' (value added attribute parquet files), 'mainstems' (mainstem lookup tables), or 'all' (the default) for everything in the data directory.
logical if TRUE, the default in an interactive session, asks for confirmation before deleting.
character vector of paths removed, invisibly.
# pointed at an empty temporary directory here so the example does not
# remove anything you have actually cached
old_dir <- hydrogeofetch_data_dir()
hydrogeofetch_data_dir(file.path(tempdir(), "hgf_cache_demo"))
hydrogeofetch_cache_clear(ask = FALSE)
hydrogeofetch_data_dir(old_dir)