drop_cache
to
reset the cache only for particular arguments.R/memoise.R
forget.Rd
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 |
---|
memX <- memoise(function() { Sys.sleep(1); runif(1) }) # The forget() function system.time(print(memX()))#> [1] 0.08075014#> user system elapsed #> 0.001 0.000 1.003#> [1] 0.08075014#> user system elapsed #> 0.001 0.000 0.000forget(memX)#> [1] TRUE#> [1] 0.834333#> user system elapsed #> 0.000 0.000 1.047