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

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

hadley/memoise documentation built on Nov. 8, 2018, 11:20 a.m.