drop_cache: Drops the cache of a memoised function for particular...

Description Usage Arguments Value See Also Examples

View source: R/memoise.R

Description

Drops the cache of a memoised function for particular arguments.

Usage

1

Arguments

f

Memoised function.

Value

A function, with the same arguments as f, that can be called to drop the cached results of f.

See Also

has_cache, memoise

Examples

1
2
3
4
5
6
7
8
mem_sum <- memoise(sum)
mem_sum(1, 2, 3)
mem_sum(2, 3, 4)
has_cache(mem_sum)(1, 2, 3) # TRUE
has_cache(mem_sum)(2, 3, 4) # TRUE
drop_cache(mem_sum)(1, 2, 3) # TRUE
has_cache(mem_sum)(1, 2, 3) # FALSE
has_cache(mem_sum)(2, 3, 4) # TRUE

memoise documentation built on Nov. 26, 2021, 5:33 p.m.