CRAN policy permits a package to use tools::R_user_dir() "provided that by
default sizes are kept as small as possible and the contents are actively
managed (including removing outdated material)". Actively managed means the
package has a retention policy, not that it ships a function users might
discover. getaca therefore collects conservatively after every successful
retrieval, and getaca_clean() exists for the deliberate case.
Usage
getaca_clean(
name = NULL,
package = NULL,
what = c("broken", "temp", "superseded", "lru", "unreferenced"),
dry_run = FALSE
)Details
Removal order, cheapest and safest first:
broken and incomplete material
abandoned temporary transfers
superseded unpinned versions, once past the retention period
least recently used unpinned resources, only when over the size ceiling
bytes in the store that no declaration references any more
"Superseded" and "not recently used" are different states and age on different clocks, so an expensive resource is not deleted merely for being old.
A version slot holds a name for bytes the store owns, so the sweeps above remove names. Bytes go once the last name for them does, which is why the store sweep runs last.
Never removed: pinned entries, the version the bundled registry currently names, and anything under an active lock.