How to see arguments of a function in R?

r

#1

I have created a function in R. After creating the function to know the arguments of a function I have used the args function which tell about the arguments of a function but I am getting NULL.

 simon_says <- function(...){
      paste("Simon says:", ...)
     }

function (...) 
NULL

#2

hi @harry,

the args just displays the argument names and corresponding default values of a function,

add1 <- function(x =10,y = 20){
  z = x+y
  z
}
> args(add1)
function (x = 10, y = 20) 
NULL

#3

You can just type simon_says without the parantheses. Or if you would like it as a list object that can access, try formals(simon_says).