Open In App

Coercing an Object of mode "list" to mode "call" in R Programming - as.call() Function

Last Updated : 19 Jun, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
as.call() function in R Language is used to coerce the object of mode "list" to mode "call". The first element of the list becomes the function part of the call.
Syntax: as.call(x) Parameters: x: an arbitrary R object
Example 1: Python3
# R program to illustrate
# as.call function

# Calling the as.call() function
as.call(list(list, 5, 10))
as.call(list(as.name("::"), as.name("list"), as.name("base")))
Output:
.Primitive("list")(5, 10)
list::base
Example 2: Python3
# R program to illustrate
# as.call function

# Initializing a function round
f <- round

# Calling the as.call() function
as.call(list(f, quote(A)))
Output:
.Primitive("round")(A)

Next Article

Similar Reads

  翻译: