forget | R Documentation |
drop_cache
to
reset the cache only for particular arguments.Forget past results.
Resets the cache of a memoised function. Use drop_cache
to
reset the cache only for particular arguments.
forget(f)
f |
memoised function |
memoise
, is.memoised
, drop_cache
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()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.