I was wondering how to get arguments for R functions. Is there any R function which can be used to get all arguments for a certain function?

As R function glm has the following arguments

glm(formula, family = gaussian, data, weights, subset,
na.action, start = NULL, etastart, mustart, offset,
control = list(...), model = TRUE, method = "glm.fit",
x = FALSE, y = TRUE, contrasts = NULL, ...)

How these arguments can be obtained on R console? Thanks

  • $\begingroup$ If R is only tag for your question then this question is better fit on StackOverflow.com $\endgroup$ – Marek May 20 '11 at 10:12

You could use something like formals() or args(), e.g. formals(glm) gives:

> formals(glm)











[1] TRUE

[1] "glm.fit"


[1] TRUE

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.