File: has_cache.Rd

package info (click to toggle)
r-cran-memoise 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 208 kB
  • sloc: sh: 10; makefile: 5
file content (27 lines) | stat: -rw-r--r-- 694 bytes parent folder | download
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/memoise.R
\name{has_cache}
\alias{has_cache}
\title{Test whether a memoised function has been cached for particular arguments.}
\usage{
has_cache(f)
}
\arguments{
\item{f}{Function to test.}
}
\value{
A function, with the same arguments as \code{f}, that can be called to test
  if \code{f} has cached results.
}
\description{
Test whether a memoised function has been cached for particular arguments.
}
\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
}
\seealso{
\code{\link{is.memoised}}, \code{\link{memoise}}, \code{\link{drop_cache}}
}