has_cache | R Documentation |
Test whether a memoised function has been cached for particular arguments.
has_cache(f)
f |
Function to test. |
A function, with the same arguments as f
, that can be called to test
if f
has cached results.
is.memoised
, memoise
, drop_cache
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.