I'm using Roxygen2 for documentation and I cannot get the order of parameters to be right. Specifically, I have 3 sets of parameters for this one set of methods:
I have not been able to get it into proper order: The most common order is n, p3-p5, r. If I remove n, I get p3-p5, r. If I have 2 n's, I get n, p3-p5, n, r. If I have 2 r's and no n's, I get p3-p5, r, r.
Any advice on how to fix this. If you think it has to do with the current layout, it's:
#' @templateVar ... ...
#' @param n ...
#' @template t1 # Template for r
#' @template t2 # Template for p3-p5
#' @details ...
#' ...
where t2's layout is:
#' @param p3
#' @param p4
#' @param p5
#' @details ...
#' @return ...
#' ...
Other fixes for this I have found do not seem to work. Also, I would love for n to be part of the t2 template, but I assume that's unreasonable.
Well, congratulate me, because I spend a good 45 minutes trying to figure this out without realizing that the parameters are ordered to sync with the function usage parameter, and r was not supposed to be there anyways.
Fix ended up being that "r" (or the parameter that "r" stands for) did not directly match any of the parameters of the function, so it got thrown to the end. I feel stupid. Whatever, though. Maybe this will be a good warning for future users.