% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/function.R
\name{Memoize.function}
\alias{Memoize.function}
\title{Memoize a function}
\usage{
Memoize.function(fun, suffix = ".RcacheDiceView")
}
\arguments{
\item{fun}{function to memoize}

\item{suffix}{suffix to use for cache files (default ".RcacheDiceView")}
}
\value{
a function with same behavior than argument one, but using cache.
}
\description{
Before each call of a function, check that the cache holds the results and returns it if available. Otherwise, compute f and cache the result for next evluations.
}
\examples{
f=function(n) rnorm(n);
F=Memoize.function(f);
F(5); F(6); F(5)
}
