md5_cache: md5 checksum function

Description Usage Arguments Details Value Examples

Description

Creates a wrapper for generating the md5 checksum for the calling function and its arguments. If a file with the md5 as its filename exists in the specified folder then this is loaded. Otherwise the function is evaluated and the results are stored in the specified folder.

Usage

1
md5_cache(path)

Arguments

path

the path to where the files will be cached.

Details

md5 checksums on the called function and any function-arguments are generated by creating a text file in the specified folder and digesting the text file before deleting it. md5 checksums on character arguments are carried out on the file (if the file exists) or on the character as appropriate.

Value

An md5 wrapper for intensive computations. This has arguments

Examples

1
2
3
4
myfun1 <- function(x) x^2
myfun2 <- function(y,f) y^3 + f(y)
md5_wrapper <- md5_cache(".")
x <- md5_wrapper(myfun2,2,myfun1)

andrewzm/atminv documentation built on May 10, 2019, 11:14 a.m.