forget: Forget past results. Resets the cache of a memoised function....

View source: R/memoise.R

forgetR Documentation

Forget past results. Resets the cache of a memoised function. Use drop_cache to reset the cache only for particular arguments.

Description

Forget past results. Resets the cache of a memoised function. Use drop_cache to reset the cache only for particular arguments.

Usage

forget(f)

Arguments

f

memoised function

See Also

memoise, is.memoised, drop_cache

Examples

memX <- memoise(function() { Sys.sleep(1); runif(1) })
# The forget() function
system.time(print(memX()))
system.time(print(memX()))
forget(memX)
system.time(print(memX()))

hadley/memoise documentation built on Jan. 5, 2024, 10:35 a.m.