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

has_cache {memoise} | R Documentation

## 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.
`...` | arguments to function.

### See Also

`is.memoised`, `memoise`

### 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

[Package memoise version 1.1.0 Index]