Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

do.call2

Execute a function call similar to do.call.


Description

This function is supposed to be a replacement for do.call in situations where you need to pass big R objects. Unlike do.call, this function allows to pass objects via ... to avoid a copy.

Usage

do.call2(fun, ..., .args = list())

Arguments

fun

[character(1)]
Name of the function to call.

...

[any]
Arguments to fun. Best practice is to specify them in a key = value syntax.

.args

[list]
Arguments to fun as a (named) list. Will be passed after arguments in .... Default is list().

Value

Return value of fun.

Examples

## Not run: 
  library(microbenchmark)
  x = 1:1e7
  microbenchmark(do.call(head, list(x, n = 1)), do.call2("head", x, n = 1))

## End(Not run)

BBmisc

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.