R: Function Calls

call {base} | R Documentation

## Function Calls

### Description

Create or test for objects of mode `"call"`.

### Usage

    call(name, ...)
    is.call(x)
    as.call(x)

### Arguments

`name` | a character string naming the function to be called.
`...` | arguments to be part of the call.
`x` | an arbitrary R object.

### Value

`call` returns an unevaluated function call, that is, an unevaluated expression which consists of the named function applied to the given arguments (`name` must be a quoted string which gives the name of a function to be called).
`is.call` is used to determine whether `x` is a call (i.e., of mode `"call"`).
It is not possible to coerce objects to mode call (objects either are calls or they are not calls). `as.call` returns its argument if it is a call and otherwise terminates with an error message.

### See Also

`do.call` for calling a function by name and argument list; `Recall` for recursive calling of functions; further `is.language`, `expression`, `function`.

### Examples

    is.call(call) #-> FALSE: Functions are NOT calls

    # set up a function call to round with argument 10.5
    cl <- call("round", 10.5)
    is.call(cl)# TRUE
    cl
    # such a call can also be evaluated.
    eval(cl)# [1] 10

[Package Contents]