memoise (version 2.0.1)

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

is.memoised, memoise, drop_cache

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab