do.call: Memory safe alternative to 'do.call'

doCallSafeR Documentation

Memory safe alternative to do.call

Description

doCallSafe is an alternative implementation for do.call that does not evaluate the args prior to running. This means that R does not become unresponsive when there are large objects in the args. This should be used always instead of do.call, whenever there are possibly large objects within the args. This is a verbatim copy from package Gmisc at https://search.r-project.org/CRAN/refmans/Gmisc/html/fastDoCall.html

Usage

doCallSafe(what, args, quote = FALSE, envir = parent.frame())

Arguments

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.

Value

Same as do.call, but without the memory inefficiency.


SpaDES.core documentation built on Jan. 11, 2026, 9:06 a.m.