I have a package of functions; one function has 22 parameters (including ...
). I've recently moved a parameter from being a ...
option to being a full parameter, and noticed that even though it's described in the logical order in the function parameters list, and in the same order in the roxygen2 @params items list, when I document()
, the new item is below the ...
item at the bottom, and is itself followed by another param which I've got in the logical place too.
Example: Script looks like this:
#' @param ParameterA does something
#' @param ParameterB does something else
#' @param ... optional extras
foo <- function(ParameterA, ParameterB, ...)
Rd & help file look like this:
Arguments
Parameter A does something
... optional extras
Parameter B does something else
I know this is petty but does anyone know how to fix this? I deleted the .Rd file and redocument()
ed to no avail.
Imgur album (3 pics) of screenshots here: https://i.sstatic.net/VNqG7.jpg
Edit: more digging: I ran build & reload, check, and saw:
Documented arguments not in \usage in documentation object 'gbm.auto':‘tc’ ‘mapshape’.
Functions with \usage entries need to have the appropriate \alias entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
Last paragraph before "RC" here says @usage
no longer required since v3 of roxygen2 generates this automatically. But this isn't working for me any more, despite having worked in the past.
Found the culprit: another script was in the R
folder with the same function within it (essentially a draft/fork of the main function with something I'm trying to change it to). (I assume that) document()
was writing the Rd file for gbm.auto from gbm.auto.R then overwriting the Rd file from gbm.auto_binonly.R, deleting all the changes. Sorry folks