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

has_cache

Test whether a memoised function has been cached for particular arguments.


Description

Test whether a memoised function has been cached for particular arguments.

Usage

has_cache(f)

Arguments

f

Function to test.

Value

A function, with the same arguments as f, that can be called to test if f has cached results.

See Also

Examples

mem_sum <- memoise(sum)
has_cache(mem_sum)(1, 2, 3) # FALSE
mem_sum(1, 2, 3)
has_cache(mem_sum)(1, 2, 3) # 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.