has_cache: Test whether a memoised function has been cached for...

Description Usage Arguments Value See Also Examples

View source: R/memoise.R

Description

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

Usage

1

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

1
2
3
4
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 documentation built on Nov. 26, 2021, 5:33 p.m.