do.call.cached: Execute a Function Call (Cached)

Description Usage Arguments Details See Also Examples

Description

Wrapper function to implement caching for do.call using RDS-files.

Usage

1
do.call.cached(rds, what, args, quote = FALSE, envir = parent.frame())

Arguments

rds

The name of the file in which the cache is to be stored.

what

Either a function or a non-empty character string naming the function to be called.

args

A list of arguments to the function call. The names attribute of args gives the argument names.

quote

A logical value indicating whether to quote the arguments.

envir

An environment within which to evaluate the call. This will be most useful if what is a character string and the arguments are symbols or quoted expressions.

Details

If the rds file exists, the object will be loaded from the rds. Otherwise the function what will be called via do.call and an rds of the resulting object will be saved.

See Also

do.call which constructs and executes the function call.

Examples

1
2
do.call.cached("testdata.rds", "read.csv", "testdata.csv")
do.call.cached("testdata.rds", read.csv, "testdata.csv")

erikjandevries/r.dstools.ej documentation built on May 24, 2019, 4:02 a.m.