Coercing an Object of mode “list” to mode “call” in R Programming – as.call() Function
Last Updated :
19 Jun, 2020
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:
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:
f < - round
as.call( list (f, quote(A)))
|
Output:
.Primitive("round")(A)
Share your thoughts in the comments
Please Login to comment...