3

Usually in html help of a package in R argument list, ends with

........ other arguments passed.

but how can we print all the arguments of a function in R.

Scott Ritchie
  • 10,293
  • 3
  • 28
  • 64
  • 1
    Welcome to Stack Overflow, please take the [Tour](http://stackoverflow.com/tour). – DavidPostill Aug 16 '14 at 18:59
  • 2
    `args(FUN)` and `formals(FUN)` are the usual methods. The `...` arguments depend on where the `...` is being passed to. – Rich Scriven Aug 16 '14 at 19:03
  • I guess question is about the `...` in R functions arguments like here `lm(formula, data, subset, weights, na.action, method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE, contrasts = NULL, offset, ...)`. – MYaseen208 Aug 16 '14 at 19:04
  • @MYaseen208 yes as you mentioned lm function after argument offset, "......" are written, which my indicate the presence of other arguments in functions but not all arguments are mentioned in helping material, so can we print these arguments. – Raja Fawad Zafar Aug 16 '14 at 20:27
  • @Richard Scriven i have already tried args and formals but they show only first argument – Raja Fawad Zafar Aug 16 '14 at 20:29
  • The functions the extra arguments are passed to should be listed in the `@seealso` section of the help page – Scott Ritchie Aug 17 '14 at 02:57

1 Answers1

0

If I understand your question correctly, then I tend to say: Most of the time, it is not possible to list all the possible arguments that may be passed under the ... 'section' of the function.

Please look at the very simple ?plot function. There, only two arguments, x and y are given on the help page. However, under ... there is a range of additional possible arguments. Most of them are (as the help page says) graphical parameters. In the ?lm case, I understand that the arguments in ... are passed to lm.fit and lm.wfit. Check those help pages to see which parameters these functions take.

I guess the main problem is that you have to check ALL functions, that arguments under ... may be passed to, to know ALL the possible arguments that may be passed under .... Since the number of functions may be very large, also the number of arguments working in ... may be very large. So we don't want to have them on the "top-level" help page.

I hope that made any sense...

swolf
  • 1,020
  • 7
  • 20