2

When I'm using a new function, the documentation/vignettes give an overview of how the function works, but often do not list all of the possible options for every argument.

There must (?) be a command which lists all of the valid options for an argument? After lots of Googling there are lots of answers to the question of how to list all the possible arguments of a function (args, formals etc), but nothing I can find which lists all the possible options of an argument?

For example if I type formals(lmer) or args(lmer), it just list the functions and the defaults, not all the possible options.

How can I display all the possible options that an argument can take?

zx8754
  • 52,746
  • 12
  • 114
  • 209
Tzen
  • 21
  • 5
  • 2
    I know no way to list all *possible options that an argument can take*, and I think there is no way. Just think of how many possible options the function `+` will have for `e1` and `e2`. – GKi Oct 13 '21 at 11:31
  • 1
    OK, maybe not for every single argument, but the thrust of my question is really about finding a systematic way to find options for functions where they exist. For example, if an argument will accept a fixed number of possible character strings to specify, say, plot options, how can these options be found? – Tzen Oct 13 '21 at 11:42
  • Maybe have also a look at [Is it possible to get RStudio to show function arguments and descriptions for custom functions?](https://stackoverflow.com/q/21565526/10488504). Here they say that is only possible over the help page (or over the source code). – GKi Oct 13 '21 at 11:50
  • 1
    As far as i know there exists not way to find all possible (discrete number of) options for an argument *except* if they are documented and listed in the help or by examining the source – dario Oct 13 '21 at 11:51
  • Does this answer your question? [All valid values of an argument of a function in R](https://stackoverflow.com/questions/20352842/all-valid-values-of-an-argument-of-a-function-in-r) – A. S. K. Oct 14 '21 at 19:55

0 Answers0