Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

drop_cache

Drops the cache of a memoised function for particular arguments.


Description

Drops the cache of a memoised function for particular arguments.

Usage

drop_cache(f)

Arguments

f

Memoised function.

Value

A function, with the same arguments as f, that can be called to drop the cached results of f.

See Also

Examples

mem_sum <- memoise(sum)
mem_sum(1, 2, 3)
mem_sum(2, 3, 4)
has_cache(mem_sum)(1, 2, 3) # TRUE
has_cache(mem_sum)(2, 3, 4) # TRUE
drop_cache(mem_sum)(1, 2, 3) # TRUE
has_cache(mem_sum)(1, 2, 3) # FALSE
has_cache(mem_sum)(2, 3, 4) # TRUE

memoise

Memoisation of Functions

v2.0.0
MIT + file LICENSE
Authors
Hadley Wickham [aut], Jim Hester [aut, cre], Winston Chang [aut], Kirill Müller [aut], Daniel Cook [aut], Mark Edmondson [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.