Last data update: 2014.03.03

R: Executes a function call with option to ignore unused...
doCallR Documentation

Executes a function call with option to ignore unused arguments

Description

Executes a function call with option to ignore unused arguments.

Usage

## Default S3 method:
doCall(.fcn, ..., args=NULL, alwaysArgs=NULL, .functions=list(.fcn),
  .ignoreUnusedArgs=TRUE, envir=parent.frame())

Arguments

.fcn

A function or a character string specifying the name of a function to be called.

...

Named arguments to be passed to the function.

args

A list of additional named arguments that will be appended to the above arguments.

alwaysArgs

A list of additional named arguments that will be appended to the above arguments and that will never be ignore.

.functions

A list of function:s or names of functions. This can be used to control which arguments are passed.

.ignoreUnusedArgs

If TRUE, arguments that are not accepted by the function, will not be passed to it. Otherwise, all arguments are passed.

envir

An environment in which to evaluate the call.

Author(s)

Henrik Bengtsson

See Also

do.call().

Examples

  doCall("plot", x=1:10, y=sin(1:10), col="red", dummyArg=54,
         alwaysArgs=list(xlab="x", ylab="y"),
         .functions=c("plot", "plot.xy"))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(R.utils)
Loading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.7.1 (2016-02-15) successfully loaded. See ?R.methodsS3 for help.
R.oo v1.20.0 (2016-02-17) successfully loaded. See ?R.oo for help.

Attaching package: 'R.oo'

The following objects are masked from 'package:methods':

    getClasses, getMethods

The following objects are masked from 'package:base':

    attach, detach, gc, load, save

R.utils v2.3.0 (2016-04-13) successfully loaded. See ?R.utils for help.

Attaching package: 'R.utils'

The following object is masked from 'package:utils':

    timestamp

The following objects are masked from 'package:base':

    cat, commandArgs, getOption, inherits, isOpen, parse, warnings

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/R.utils/doCall.Rd_%03d_medium.png", width=480, height=480)
> ### Name: doCall
> ### Title: Executes a function call with option to ignore unused arguments
> ### Aliases: doCall.default doCall
> ### Keywords: programming
> 
> ### ** Examples
> 
>   doCall("plot", x=1:10, y=sin(1:10), col="red", dummyArg=54,
+          alwaysArgs=list(xlab="x", ylab="y"),
+          .functions=c("plot", "plot.xy"))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>