It is recommended that functions in a package are not memoised at build-time,
but when the package is loaded. The simplest way to do this is within
\code{.onLoad()} with, for example
fun <- function() {
some_expensive_process()
zzz.R
.onLoad <- function(libname, pkgname) {
fun <<- memoise::memoise(fun)
}
It is recommended that functions in a package are not memoised at build-time, but when the package is loaded. The simplest way to do this is within \code{.onLoad()} with, for example