Create an Object of mode call in R Programming – call() Function
call() function in R Language is used to create or test for objects of mode “call”.
Syntax: call(name, …)
Parameters:
name: a non-empty character string naming the function to be called
…: arguments to be part of the call
Example 1:
# R program to illustrate# call function # Calling call() functionx <- call("sin", 23)y <- call("cos", 0)xy # Evaluating values of calleval(x)eval(y) |
Output:
sin(23) cos(0) [1] -0.8462204 [1] 1
Example 2:
# R program to illustrate# call function # Calling call() functionx <- call("round", 10.5)x # Initializing a round characterf <- "round" # Calling call() functioncall(f, quote(A)) |
Output:
round(10.5) round(A)
Example 3:
# R program to illustrate# call function # Initializing round value# without its characterf <- round # Calling call() function# which will give an error# bcs the argument should be# a character stringcall(f, quote(A)) |
Output:
Error in call(f, quote(A)) : first argument must be a character string Execution halted


