cache_op: Wrapper to add caching to functions

Description Usage Arguments Value Examples

Description

Wrapper to add caching to functions

Usage

1
2
cache_op(fun, quer, use_cache = TRUE, overwrite = FALSE,
  max_lifetime = 30, ...)

Arguments

fun

function name (string)

quer

first argument to fun

use_cache

should we use cache this time

overwrite

if cached file exists, should the function run and overwrite?

max_lifetime

max acceptable age of a cached object, in days

...

other parameters passed to fun

Value

typical fun, query, ellipsis result

Examples

1
2
3
4
cache_op("sin", pi)
cache_op("read.csv",
"http://www.sample-videos.com/csv/Sample-Spreadsheet-10-rows.csv",
header = TRUE)

stillmatic/catcher documentation built on May 30, 2019, 5:44 p.m.