Monday, 20 July 2015

R: formals : Get the formal argument of a function

“formals” function is used to get formal arguments of a function.

For example, serialize function has following signature.

serialize(object, connection, ascii, xdr = TRUE,
          version = NULL, refhook = NULL)
When you call formals function with serialize as argument, it returns all formal parameters of the function serialise.

> formals(serialize)
$object


$connection


$ascii
[1] FALSE

$xdr
[1] TRUE

$version
NULL

$refhook
NULL


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment