File: drop_cache.Rd

package info (click to toggle)
r-cran-memoise 2.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 208 kB
  • sloc: sh: 10; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 773 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/memoise.R
\name{drop_cache}
\alias{drop_cache}
\title{Drops the cache of a memoised function for particular arguments.}
\usage{
drop_cache(f)
}
\arguments{
\item{f}{Memoised function.}
}
\value{
A function, with the same arguments as \code{f}, that can be called to drop
  the cached results of \code{f}.
}
\description{
Drops the cache of a memoised function for particular arguments.
}
\examples{
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
}
\seealso{
\code{\link{has_cache}}, \code{\link{memoise}}
}