Skip to contents

info lists the System 1 answer cache, the System 2 answer cache used for replay, temporary spill files and unapplied document sidecars (deferred or pending blocks; they are never removed here: apply them with gptr_doc(path, sync = TRUE)). prune removes System 2 answers whose block is neither in its document nor queued for it in a sidecar, System 1 answers unused for 90 days, temporary files older than getOption("gptr.spill_days", 7) days and older refreshed model catalogs; clear removes a kind entirely.

Usage

gptr_cache(
  action = c("info", "prune", "clear"),
  kind = c("all", "s1", "s2", "tmp")
)

Arguments

action

"info", "prune" or "clear".

kind

"all", "s1", "s2" or "tmp".

Value

info: a gptr_cache_info data frame with columns kind, entries, bytes, oldest, path. prune and clear: the number of files removed, invisibly.

Details

Clearing the System 2 answer cache does not remove the R code of document blocks, but saved answers needed to reconstruct a replayed call may no longer be available.

Examples

gptr_cache()
#>   kind     entries  bytes  oldest  path
#> 1 s1       0        0      NA      /tmp/Rtmpu3CdAi/rel-site-...
#> 2 s2       0        0      NA      /tmp/Rtmpu3CdAi/rel-site-...
#> 3 tmp      0        0      NA      /tmp/Rtmpu3CdAi/rel-site-...
#> 4 sidecar  0        0      NA      /tmp/Rtmpu3CdAi/rel-site-...
#> 
#> # 4 rows
gptr_cache("prune", "tmp")