Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@inheritParams: what to do when using ... #1512

Closed
dsweber2 opened this issue Sep 6, 2023 · 1 comment
Closed

@inheritParams: what to do when using ... #1512

dsweber2 opened this issue Sep 6, 2023 · 1 comment

Comments

@dsweber2
Copy link

dsweber2 commented Sep 6, 2023

We have a function which inherits all the parameters from another function, and want to just pass ... on to the next function. But document both complains that ... isn't documented, and it doesn't include the arguments from the other function.

A minimal example of what I'm talking about:

#' @param a an argument
#' @param b a different argument
foo <- function(a=3, b=5) {}
#' @param extra_arg an argument giving the extra functionality
#' @inheritParams foo
bar <- function(extra_arg, ...) {
   foo(...)
}

In the docs, it would be useful if bar showed all the arguments of foo, but there doesn't seem to be a way to do this, unless you copy every argument.

@dsweber2
Copy link
Author

dsweber2 commented Sep 8, 2023

Found it; it's documented here. Sorry for the issue spam.

@inheritDotParams ${1:source} ${2:arg1 arg2 arg3}: Automatically generate documentation for ... when you're passing dots along to another function.

@dsweber2 dsweber2 closed this as completed Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant