⚠️There's a newer version (2.0.1) of this package. Take me there.

memoise

If a function is called multiple times with the same input, you can often speed things up by keeping a cache of known answers that it can retrieve. This is called memoisation http://en.wikipedia.org/wiki/Memoization. The memoise package provides a simple syntax

mf <- memoise(f)

to create mf(), a memoised wrapper around f(). You can clear mf's cache with

forget(mf)

, and you can test whether a function is memoised with

is.memoised(mf) # TRUE
is.memoised(f)  # FALSE

.

Copy Link

Version

Down Chevron

Install

install.packages('memoise')

Monthly Downloads

663,235

Version

1.0.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

January 29th, 2016

Functions in memoise (1.0.0)