I'm writing a package that has an internal function that several other exported functions use, but the exported functions all have different parameters.
Here is a simplification of what I mean:
general <- function(...) {
# do something based on which function was called
}
one <- general
two <- general
I know it might seem weird, but all the functions that are aliased to general
use the exact same code but they have different parameters. So I might call one(id = "foo")
or two(class = "bar")
.
My question is how do I document these functions with roxygen in a way that R CMD check won't complain?
I want to document each function with its proper parameters, so this was what I was hoping to be able to use:
general <- function(...) {
# do something based on which function was called
}
#' @param id The id
#' @export
one <- general
#' @param class The class
#' @export
two <- general
But then I get WARNINGs when I check my package such as
* checking Rd \usage sections ... WARNING
Undocumented arguments in documentation object 'one'
'...'
Documented arguments not in \usage in documentation object 'one':
'id'
And similar warnings for the two
function.
I tried editing the .Rd files by hand to change
\usage{ one(...) }
Into
\usage{ one(id) }
To try to fix this WARNING, but when I run the check it seems to be creating the documentation again and overwriting my change.
Is there a workaround for this?
Thanks